[FFmpeg-devel] [PATCH 1/2] libavcodec/pgxdec: Add PGX decoder

Nicolas George george at nsup.org
Mon Jun 29 15:57:46 EEST 2020


Gautam Ramakrishnan (12020-06-27):
> I used 9 digits because I was using a fixed size string to store the number
> and then used strol. Now as I removed the usage of strol, it wasnt necessary.
> Do you thing using a loop of fixed iterations is a good idea?  Is it better if
> I use the for loop again?

You need to write it as the format demands. If there is an official
limit on the size of the numbers, then use that. Otherwise, if it is
possible to write the width as 00000000000000000000000000000640, then
your parser should accept that, and find another way to avoid the
overflow. Checking for INT_MAX/10 before multiplying seems like an easy
and obvious solution.

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: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200629/107d4237/attachment.sig>


More information about the ffmpeg-devel mailing list