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-11-03 19:48:29 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-01 00:56:14 +0300
commit1376beb658d3a4bac3ec6b317332c734ec4a2460 (patch)
tree9d0db3122ebb4e882ef447d3e66e447fbf2be1fd /libavcodec/xan.c
parent907a704c9f6c4255bccdb2a45cb89d94e4520257 (diff)
avcodec/xan: Check for bitstream end in xan_huffman_decode()
Fixes: Timeout Fixes: 3707/clusterfuzz-testcase-6465922706440192 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4b51437dccd62fc5491280db44e3c21b44aeeb3f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r--libavcodec/xan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 85fa8e7394..cafcbed9dc 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -130,7 +130,10 @@ static int xan_huffman_decode(uint8_t *dest, int dest_len,
return ret;
while (val != 0x16) {
- unsigned idx = val - 0x17 + get_bits1(&gb) * byte;
+ unsigned idx;
+ if (get_bits_left(&gb) < 1)
+ return AVERROR_INVALIDDATA;
+ idx = val - 0x17 + get_bits1(&gb) * byte;
if (idx >= 2 * byte)
return AVERROR_INVALIDDATA;
val = src[idx];