[FFmpeg-devel] [patch] infinite loop

Thilo Borgmann thilo.borgmann at googlemail.com
Wed Jan 4 20:49:00 CET 2012


Am 04.01.12 04:58, schrieb Michael Niedermayer:
> On Tue, Jan 03, 2012 at 10:26:53PM -0500, Philippe Saint-Pierre wrote:
>> Hi,
>>
>> I noticed an infinite loop in libavcodec/alsdec.c (zero_remaining())
>>
>> Here is patch attached.
>>
>> --
>> Philippe Saint-Pierre
> 
>> --- libavcodec/alsdec.c~	2012-01-03 22:22:16.642164621 -0500
>> +++ libavcodec/alsdec.c	2012-01-03 22:22:19.950164532 -0500
>> @@ -1009,13 +1009,13 @@
>>  static void zero_remaining(unsigned int b, unsigned int b_max,
>>                             const unsigned int *div_blocks, int32_t *buf)
>>  {
>>      unsigned int count = 0;
>>  
>>      while (b < b_max)
>> -        count += div_blocks[b];
>> +        count += div_blocks[b++];
>>  
>>      if (count)
>>          memset(buf, 0, sizeof(*buf) * count);
>>  }
> 
> its clear the in git code is wrong and this may be the correct
> solution ...
> 
> thilo can you take a look ?

The solution looks ok to me - I think we can apply that for the time being.

Once I'm home again I will verify that again.

Philipe, does your file include CRC checksums, are these correct using the patch?
It would also be great if you could upload your file you've spotted this bug
with :)
Seems like our test suite covers b == b_max cases only...

-Thilo


More information about the ffmpeg-devel mailing list