diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-09 11:49:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-13 13:02:27 +0200 |
commit | d893253fcd93d11258e98857175e93be7d158708 (patch) | |
tree | 70ef2fcd69da5741b3e60be776dde9c983b2dc19 | |
parent | bf10b862fa1d09d9983c63da4ecae80ebe68c28e (diff) | |
download | ffmpeg-d893253fcd93d11258e98857175e93be7d158708.tar.gz |
avcodec/ffv1dec: Fix out of array read in slice counting
Fixes: test-201710.mp4
Found-by: 连一汉 <lianyihan@360.cn> and Zhibin Hu
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c20f4fcb74da2d0432c7b54499bb98f48236b904)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ffv1dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 7e9130aa3b..0b8eef9384 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -787,7 +787,7 @@ static int read_header(FFV1Context *f) } else { const uint8_t *p = c->bytestream_end; for (f->slice_count = 0; - f->slice_count < MAX_SLICES && 3 < p - c->bytestream_start; + f->slice_count < MAX_SLICES && 3 + 5*!!f->ec < p - c->bytestream_start; f->slice_count++) { int trailer = 3 + 5*!!f->ec; int size = AV_RB24(p-trailer); |