[FFmpeg-cvslog] r12983 - trunk/libavcodec/mpegaudiodec.c

Benoit Fouet benoit.fouet
Mon Apr 28 13:53:39 CEST 2008


Baptiste Coudurier wrote:
> Hi Mans,
>
> M?ns Rullg?rd wrote:
>   
>> Baptiste Coudurier wrote:
>>     
>>> Hi Benoit,
>>>
>>> Benoit Fouet wrote:
>>>       
>>>> bcoudurier wrote:
>>>>         
>>>>> Modified: trunk/libavcodec/mpegaudiodec.c
>>>>> ==============================================================================
>>>>> --- trunk/libavcodec/mpegaudiodec.c	(original)
>>>>> +++ trunk/libavcodec/mpegaudiodec.c	Sat Apr 26 14:51:52 2008
>>>>> @@ -2581,12 +2581,9 @@ static int decode_frame_mp3on4(AVCodecCo
>>>>>      for (fr = 0; fr < s->frames; fr++) {
>>>>>          start = start2;
>>>>>          fsize = (start[0] << 4) | (start[1] >> 4);
>>>>> +        fsize = FFMIN3(fsize, len, MPA_MAX_CODED_FRAME_SIZE);
>>>>>          start2 += fsize;
>>>>>
>>>>>           
>>>> shouldn't those two last lines be swapped ?
>>>>
>>>>         
>>> Why that ? Besides code has changed again.
>>>       
>> The code doesn't do the same thing after this change.  Previously, start2
>> was incremented with the value of fsize before clamping, now it's done
>> after.  I haven't tried to figure out which is correct.
>>     
>
> Ok, yes, it was intended, fsize must be checked before being added to
> start2, and must be <= len which is input size left.
>
> I can add a note about this change in commit message if wanted.
>
>   

I only wanted to know whether that was done on purpose or not

-- 
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-cvslog mailing list