X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fac3.c;h=b54315dcb37425a1ffab94a3d755301c812a9cae;hb=c720b9ce9850710e74a103d9626869e397a89faa;hp=c4fc77cbdf95a5111c65590c691c1823156fb2a1;hpb=a2dd2d7998a775167c18e844193b3686590934c1;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;