Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-10-09 12:49:28 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-10-11 00:58:41 +0300
commitc20f4fcb74da2d0432c7b54499bb98f48236b904 (patch)
tree59db97838648684c96e81644d605cae4dc8ee752 /libavcodec/ffv1dec.c
parentbdee75a4e750735ab3039f004275ac8479072048 (diff)
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>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index d2bfee784f..5eadb6b158 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -717,7 +717,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);