Browse Source

avcodec/snowdec: Check width

Fixes: out of array read
Fixes: 1419/clusterfuzz-testcase-minimized-6108700873850880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 78aa93807b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.1
Michael Niedermayer 8 years ago
parent
commit
b4cea069a5
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/snowdec.c

+ 4
- 0
libavcodec/snowdec.c View File

@@ -384,6 +384,10 @@ static int decode_header(SnowContext *s){
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_count %d too large for size\n", s->spatial_decomposition_count);
return AVERROR_INVALIDDATA;
}
if (s->avctx->width > 65536-4) {
av_log(s->avctx, AV_LOG_ERROR, "Width %d is too large\n", s->avctx->width);
return AVERROR_INVALIDDATA;
}


s->qlog += get_symbol(&s->c, s->header_state, 1);


Loading…
Cancel
Save