[FFmpeg-devel] [PATCH 1/2] avformat/utils: avoid unsigned integer overflows

Marton Balint cus at passwd.hu
Sat Feb 15 18:35:40 EET 2020



On Sat, 15 Feb 2020, Nicolas George wrote:

> Marton Balint (12020-02-15):
>>> +    if (s->nb_streams)
>>>     for (i = s->nb_streams - 1; i >= 0; i--)
>> Maybe rewrite the loop instead?
>>       for (i = s->nb_streams; i-- > 0;)
>
> Or
>
>    for (i = s->nb_streams - 1; i < s->nb_streams; i--)

Or simply change the loops to normal ascending order? I don't see why 
these are descending loops in the first place.

Regards,
Marton


More information about the ffmpeg-devel mailing list