Michael Niedermayer (12019-02-27):
> >                  if (attr_names[i].type == ATTR_NAME_TYPE_INT) {
> > -                    int val = atoi(value);
> > -                    if (val > 32) {
> > +                    long int val = strtol(value, NULL, 10);
> > +                    if (errno == ERANGE || val > INT_MAX || val < INT_MIN) 
> > {
> 
> i belive strtol can fail with other errno values

And errno is not reset in case of successful completion. It needs to be
cleared beforehand.

To check if a conversion error happened, the middle argument is the
proper tool.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to