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>2019-06-05 13:18:54 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-14 22:36:39 +0300
commita7e3b271fc9a91c5d2e4df32e70e525c15c6d3ef (patch)
tree9f724ee76407deb42f6b502ea938f043a1cecf41 /libavcodec/bitstream.c
parente78b0f83748f92ea9e93b21c36082e0dd04d7cb1 (diff)
avcodec/bitstream: Check for more conflicting codes in build_table()
Fixes: out of array read Fixes: 14563/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5646451545210880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/bitstream.c')
-rw-r--r--libavcodec/bitstream.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 590b490527..be8a0f634d 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -188,8 +188,9 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
}
for (k = 0; k < nb; k++) {
int bits = table[j][1];
+ int oldsym = table[j][0];
ff_dlog(NULL, "%4x: code=%d n=%d\n", j, i, n);
- if (bits != 0 && bits != n) {
+ if ((bits || oldsym) && (bits != n || oldsym != symbol)) {
av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
return AVERROR_INVALIDDATA;
}