aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-29 10:41:01 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-24 11:35:03 +0100
commit3d95b1a8285240f150853d4a823bc225fd3f6544 (patch)
tree10f1a22447a181355c9d1c1abcf6f5a7624b9511
parente246ea2535da863be83d94c2da3248367f5c0684 (diff)
downloadffmpeg-3d95b1a8285240f150853d4a823bc225fd3f6544.tar.gz
avcodec/motionpixels: Be more strict when parsing Huffman trees
This ensures that the number of leafs in the Huffman tree equals the number it is supposed to be and therefore ensures that the VLC tree is complete, allowing us to remove checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/motionpixels.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 0bf153f883..4b9830fbed 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -133,7 +133,7 @@ static int mp_get_code(MotionPixelsContext *mp, GetBitContext *gb, int size, int
if (mp_get_code(mp, gb, size, code + 1) < 0)
return AVERROR_INVALIDDATA;
}
- if (mp->current_codes_count >= MAX_HUFF_CODES) {
+ if (mp->current_codes_count >= mp->codes_count) {
av_log(mp->avctx, AV_LOG_ERROR, "too many codes\n");
return AVERROR_INVALIDDATA;
}