ac3: validate end in ff_ac3_bit_alloc_calc_mask
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Thu, 16 Apr 2015 19:25:26 +0000 (21:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 16 Apr 2015 19:37:16 +0000 (21:37 +0200)
commitbc4fee7f2a51635fa3c0f61d1e5164da1efeded3
treebabb46febc7a974f36b921c1d90b732a309af0eb
parent55a1d75bf7855d147f420eba36e452ae401f78cb
ac3: validate end in ff_ac3_bit_alloc_calc_mask

This fixes an invalid read if end is 0:
     band_end   = ff_ac3_bin_to_band_tab[end-1] + 1;

Depending on what is before the array, this can cause stack smashing,
when band_end becomes too large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ac3.c