Re: [FFmpeg-devel] [PATCH] aacsbr_fixed: check for envelope scalefactors overflowing

2015-11-11 Thread Michael Niedermayer
On Mon, Nov 09, 2015 at 09:16:11PM +0100, Andreas Cadhalpun wrote:
> This prevents various values from getting an insanely huge exponent.
> If someone knows a cleaner solution, thats welcome!
> 
> This is similar to commit 8978c74 for aacsbr.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  libavcodec/aacsbr_fixed.c | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)

probably ok

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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


Re: [FFmpeg-devel] [PATCH] aacsbr_fixed: check for envelope scalefactors overflowing

2015-11-11 Thread Andreas Cadhalpun
On 11.11.2015 13:48, Michael Niedermayer wrote:
> On Mon, Nov 09, 2015 at 09:16:11PM +0100, Andreas Cadhalpun wrote:
>> This prevents various values from getting an insanely huge exponent.
>> If someone knows a cleaner solution, thats welcome!
>>
>> This is similar to commit 8978c74 for aacsbr.
>>
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  libavcodec/aacsbr_fixed.c | 13 -
>>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> probably ok

Pushed.

Best regards,
Andreas

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


[FFmpeg-devel] [PATCH] aacsbr_fixed: check for envelope scalefactors overflowing

2015-11-09 Thread Andreas Cadhalpun
This prevents various values from getting an insanely huge exponent.
If someone knows a cleaner solution, thats welcome!

This is similar to commit 8978c74 for aacsbr.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/aacsbr_fixed.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c
index efe40f2..57ff28a 100644
--- a/libavcodec/aacsbr_fixed.c
+++ b/libavcodec/aacsbr_fixed.c
@@ -169,6 +169,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int 
id_aac)
 else
   temp1.mant = 0x2000;
 temp1.exp = (temp1.exp >> 1) + 1;
+if (temp1.exp > 66) { // temp1 > 1E20
+av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow 
in dequant\n");
+temp1 = FLOAT_1;
+}
 
 temp2.exp = (pan_offset - sbr->data[1].env_facs[e][k].mant) * 
alpha;
 if (temp2.exp & 1)
@@ -188,6 +192,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int 
id_aac)
 temp1.exp = NOISE_FLOOR_OFFSET - \
 sbr->data[0].noise_facs[e][k].mant + 2;
 temp1.mant = 0x2000;
+if (temp1.exp > 66) { // temp1 > 1E20
+av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow 
in dequant\n");
+temp1 = FLOAT_1;
+}
 temp2.exp = 12 - sbr->data[1].noise_facs[e][k].mant + 1;
 temp2.mant = 0x2000;
 fac   = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
@@ -208,7 +216,10 @@ static void sbr_dequant(SpectralBandReplication *sbr, int 
id_aac)
 else
 temp1.mant = 0x2000;
 temp1.exp = (temp1.exp >> 1) + 1;
-
+if (temp1.exp > 66) { // temp1 > 1E20
+av_log(NULL, AV_LOG_ERROR, "envelope scalefactor 
overflow in dequant\n");
+temp1 = FLOAT_1;
+}
 sbr->data[ch].env_facs[e][k] = temp1;
 }
 for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
-- 
2.6.2
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel