X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fac3.c;h=b54315dcb37425a1ffab94a3d755301c812a9cae;hb=16576a66626a3fdf3d599955bc69eae0a4c08647;hp=c4fc77cbdf95a5111c65590c691c1823156fb2a1;hpb=abae926ef80c8553c732b95649d334b7a91374d3;p=ffmpeg diff --git a/libavcodec/ac3.c b/libavcodec/ac3.c index c4fc77cbdf9..b54315dcb37 100644 --- a/libavcodec/ac3.c +++ b/libavcodec/ac3.c @@ -131,6 +131,9 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd, int band_start, band_end, begin, end1; int lowcomp, fastleak, slowleak; + if (end <= 0) + return AVERROR_INVALIDDATA; + /* excitation function */ band_start = ff_ac3_bin_to_band_tab[start]; band_end = ff_ac3_bin_to_band_tab[end-1] + 1;