diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-02 23:44:57 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-05 04:54:02 +0300 |
commit | 118e1b0b3370dd1c0da442901b486689efd1654b (patch) | |
tree | 5358358719c416a833c19d74bda986bceb54326e /libavcodec | |
parent | 48bc9fffd11c05e75b9125d8cd90e9263108bd83 (diff) |
avcodec/utvideodec: Fix bytes left check in decode_frame()
Fixes: out of array read
Fixes: poc-2017.avi
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utvideodec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 608c8c4998..1bcd14e74c 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -676,7 +676,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, for (j = 0; j < c->slices; j++) { slice_end = bytestream2_get_le32u(&gb); if (slice_end < 0 || slice_end < slice_start || - bytestream2_get_bytes_left(&gb) < slice_end) { + bytestream2_get_bytes_left(&gb) < slice_end + 1024LL) { av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n"); return AVERROR_INVALIDDATA; } |