On Sun, Aug 6, 2017 at 5:27 PM, Nicolas George <geo...@nsup.org> wrote:
> Le duodi 12 thermidor, an CCXXV, Paras Chadha a écrit :
> > But i am returning the size from this function. If i make them unsigned,
> > how will i return errors which are negative integers.
> > One thing i can do is pass data_size as pointer to the function. Should i
> > do that ?
> No need: you can make the variables unsigned and still return them as
> signed. The error codes never go into the variables.
In order to simplify the loop in read_packet, i have passed pointer to size
as an argument.
Also renamed the function to is_image.
> > > Use the correct bound, long is wrong.
> > okay, i was actually confused regarding the correct bound. So should i
> > INT_MAX as it is the default value max_alloc_size. Since i am adding 2879
> > at the end, so correct limiting value would be INT_MAX - 2879. Am i
> > or should i use something else ?
> You have to use the constant that corresponds to the types in the
> computation. If it is int, then INT_MAX, int64_t wants INT64_MAX and
> size_t wants SIZE_MAX.
> Nicolas George
> ffmpeg-devel mailing list
ffmpeg-devel mailing list