Browse Source

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>
tags/n4.0
Michael Niedermayer 7 years ago
parent
commit
f2318aee8c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/vp3.c

+ 3
- 1
libavcodec/vp3.c View File

@@ -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 =


Loading…
Cancel
Save