aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-11 03:38:54 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-11 19:41:43 +0100
commit2ad23b93b513d3a36af53d90dfc9ebfac80b4e3e (patch)
treee6f71a7c1b095216fa607d114de05cefae59e7b2
parentcec38382dbc8c876186c98c80823619ad6a6c41b (diff)
downloadffmpeg-2ad23b93b513d3a36af53d90dfc9ebfac80b4e3e.tar.gz
avcodec/vp3: Error out on invalid num_coeffs in unpack_vlcs()
This fixes a hypothetical integer overflow Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f2318aee8ca8df1c84092f7d6691a2d0df02c474) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vp3.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index fdffc88486..e9bb7dcb38 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -951,9 +951,11 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
Vp3Fragment *all_fragments = s->all_fragments;
VLC_TYPE(*vlc_table)[2] = table->table;
- if (num_coeffs < 0)
+ if (num_coeffs < 0) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid number of coefficients at level %d\n", coeff_index);
+ return AVERROR_INVALIDDATA;
+ }
if (eob_run > num_coeffs) {
coeff_i =