[FFmpeg-devel] [PATCH 1/3] aacsbr_fixed: avoid division by zero in sbr_gain_calc

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri Nov 20 00:16:09 CET 2015


On 19.11.2015 01:31, Michael Niedermayer wrote:
> On Thu, Nov 19, 2015 at 12:31:17AM +0100, Andreas Cadhalpun wrote:
>> So far so good. However, the next time sbr_dequant is called this breaks:
>> noise_facs[1][0].exp = 6 - 536870912 + 1 = -536870905;
>>
> 
>> This is obviously completely bogus.
> 
> yes
> 
> 
>> Instead this code needs a function like av_exp2_sf.
> 
> no, thats not the problem
> this code is missing error checks and only adding error checks will
> fix that
> 
> there is read_sbr_noise() which reads data
> there is sbr_dequant() which converts the data from "read data" to
> lets call it "dequantized data"

That makes sense, thanks for explaining.

> what you describe sounds like that sbr_dequant() is called on top of
> the output from sbr_dequant(), that sounds like a error condition
> for both fixed and float

Indeed. A patch checking for that is attached.

Best regards,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-aacsbr-don-t-call-sbr_dequant-twice-without-intermed.patch
Type: text/x-diff
Size: 1686 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151120/a7975912/attachment.patch>


More information about the ffmpeg-devel mailing list