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

2015-12-11 Thread Andreas Cadhalpun
On 11.12.2015 00:48, Michael Niedermayer wrote:
> On Mon, Nov 09, 2015 at 09:17:34PM +0100, Andreas Cadhalpun wrote:
>> On 08.11.2015 21:51, Andreas Cadhalpun wrote:
>>> On 08.11.2015 13:41, Michael Niedermayer wrote:
 From: Michael Niedermayer 

 Signed-off-by: Michael Niedermayer 
 ---
  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 < 0x4000 && a.mant > -0x4000);
 +av_assert2(a.exp <= MAX_EXP);
  return a;
  #elif 1
  int t= a.mant + 0x4000 < 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.
> 
> i assume this has been fixed so ill apply this soon

Yes. For reference the commit fixing this is 0e36a14.

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-12-10 Thread Michael Niedermayer
On Mon, Nov 09, 2015 at 09:17:34PM +0100, Andreas Cadhalpun wrote:
> On 08.11.2015 21:51, Andreas Cadhalpun wrote:
> > On 08.11.2015 13:41, Michael Niedermayer wrote:
> >> From: Michael Niedermayer 
> >>
> >> Signed-off-by: Michael Niedermayer 
> >> ---
> >>  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 < 0x4000 && a.mant > -0x4000);
> >> +av_assert2(a.exp <= MAX_EXP);
> >>  return a;
> >>  #elif 1
> >>  int t= a.mant + 0x4000 < 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.

i assume this has been fixed so ill apply this soon

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-11-09 Thread Andreas Cadhalpun
On 08.11.2015 21:51, Andreas Cadhalpun wrote:
> On 08.11.2015 13:41, Michael Niedermayer wrote:
>> From: Michael Niedermayer 
>>
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  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 < 0x4000 && a.mant > -0x4000);
>> +av_assert2(a.exp <= MAX_EXP);
>>  return a;
>>  #elif 1
>>  int t= a.mant + 0x4000 < 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
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-11-08 Thread Michael Niedermayer
From: Michael Niedermayer 

Signed-off-by: Michael Niedermayer 
---
 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 < 0x4000 && a.mant > -0x4000);
+av_assert2(a.exp <= MAX_EXP);
 return a;
 #elif 1
 int t= a.mant + 0x4000 < 0;
-- 
1.7.9.5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-11-08 Thread Andreas Cadhalpun
On 08.11.2015 13:41, Michael Niedermayer wrote:
> From: Michael Niedermayer 
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  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 < 0x4000 && a.mant > -0x4000);
> +av_assert2(a.exp <= MAX_EXP);
>  return a;
>  #elif 1
>  int t= a.mant + 0x4000 < 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.

Example backtrace from id_006808b303914475301abea20d3dd4a0c2aee5a6.aac:
(gdb) bt
#0  0x7f9707a96107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x7f9707a974e8 in __GI_abort () at abort.c:89
#2  0x7f970815845b in av_normalize1_sf (a=...) at ./libavutil/softfloat.h:82
#3  0x7f9708158596 in av_div_sf (a=..., b=...) at 
./libavutil/softfloat.h:115
#4  0x7f970815a3c3 in sbr_gain_calc (ac=0x25ed6e0, sbr=0x7f9709d7dba0, 
ch_data=0x7f9709d7dc00, e_a=0x7f9709d814e4) at libavcodec/aacsbr_fixed.c:402
#5  0x7f9708164ddf in ff_sbr_apply_fixed (ac=0x25ed6e0, sbr=0x7f9709d7dba0, 
id_aac=0, L=0x25f6180, R=0x25f81e0) at libavcodec/aacsbr_template.c:1489
#6  0x7f970810fa11 in spectral_to_sample (ac=0x25ed6e0, samples=0) at 
libavcodec/aacdec_template.c:2758
#7  0x7f9708110713 in aac_decode_frame_int (avctx=0x25eafa0, 
data=0x25f59c0, got_frame_ptr=0x7fffe9f53f9c, gb=0x7fffe9f53bf0, 
avpkt=0x7fffe9f53c80)
at libavcodec/aacdec_template.c:3053
#8  0x7f9708110a53 in aac_decode_frame (avctx=0x25eafa0, data=0x25f59c0, 
got_frame_ptr=0x7fffe9f53f9c, avpkt=0x7fffe9f53c80) at 
libavcodec/aacdec_template.c:3153
#9  0x7f97087de240 in avcodec_decode_audio4 (avctx=0x25eafa0, 
frame=0x25f59c0, got_frame_ptr=0x7fffe9f53f9c, avpkt=0x7fffe9f53f40) at 
libavcodec/utils.c:2203
...
(gdb) frame 2
#2  0x7f970815845b in av_normalize1_sf (a=...) at ./libavutil/softfloat.h:82
82  av_assert2(a.exp <= MAX_EXP);
(gdb) p a
$1 = {mant = 536870912, exp = 268435463}

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel