aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-05-30 00:43:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-05 12:43:08 +0200
commit849affacb24ccab88ccc96e79fae06148bb25013 (patch)
tree36d2ad927e97ffe04b85a014f7acb474909ddb26
parent2c44582d1fc053f3dbf2fc314666b33660a47786 (diff)
downloadffmpeg-849affacb24ccab88ccc96e79fae06148bb25013.tar.gz
avcodec/hq_hqa: Check info size
Fixes: assertion failure Fixes: 21079/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQ_HQA_fuzzer-5737046523248640 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 cf28521fee22dbe2f7eeb8ab0306c0fd0802c48a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hq_hqa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index 0a08ddef68..41bfa20f34 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -320,7 +320,7 @@ static int hq_hqa_decode_frame(AVCodecContext *avctx, void *data,
int info_size;
bytestream2_skip(&ctx->gbc, 4);
info_size = bytestream2_get_le32(&ctx->gbc);
- if (bytestream2_get_bytes_left(&ctx->gbc) < info_size) {
+ if (info_size < 0 || bytestream2_get_bytes_left(&ctx->gbc) < info_size) {
av_log(avctx, AV_LOG_ERROR, "Invalid INFO size (%d).\n", info_size);
return AVERROR_INVALIDDATA;
}