[FFmpeg-devel] [PATCH] avutil/softfloat: Assert that the exponent did not overflow the legal range in av_normalize1_sf()

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Mon Nov 9 21:17:34 CET 2015


On 08.11.2015 21:51, Andreas Cadhalpun wrote:
> On 08.11.2015 13:41, Michael Niedermayer wrote:
>> From: Michael Niedermayer <michael at niedermayer.cc>
>>
>> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
>> ---
>>  libavutil/softfloat.h |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
>> index 023ccd0..ed1aab3 100644
>> --- a/libavutil/softfloat.h
>> +++ b/libavutil/softfloat.h
>> @@ -79,6 +79,7 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
>>          a.mant>>=1;
>>      }
>>      av_assert2(a.mant < 0x40000000 && a.mant > -0x40000000);
>> +    av_assert2(a.exp <= MAX_EXP);
>>      return a;
>>  #elif 1
>>      int t= a.mant + 0x40000000 < 0;
>>
> 
> This assert would be triggered by more than 15% of my test samples for aac_fixed.
> So unless that changes, this assert shouldn't be added.

I've sent a patch fixing this. Once the patch is applied, this assert should be fine.

Best regards,
Andreas


More information about the ffmpeg-devel mailing list