[FFmpeg-devel] [PATCH] Fix sdp size check on fmtp integer parameters

Nicolas George george at nsup.org
Wed Feb 27 17:17:11 EET 2019


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190227/86b0dabe/attachment.sig>


More information about the ffmpeg-devel mailing list