aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vqavideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-19 22:26:00 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-12-23 15:22:06 +0100
commitd8ea7a67ba62f5d4520e75e56b9954d80e7ff223 (patch)
tree0fbddaa847f1a9de6299491e5169deb9accf666f /libavcodec/vqavideo.c
parent60ead5cd68586d25bd6a0c285907f72b8a2534bf (diff)
downloadffmpeg-d8ea7a67ba62f5d4520e75e56b9954d80e7ff223.tar.gz
avcodec/vqavideo: reset accounting on error
Fixes: Timeout (same growing chunk is decoded to failure repeatedly) Fixes: 42582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6531195591065600 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/vqavideo.c')
-rw-r--r--libavcodec/vqavideo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 7c1d42bcac..1d97855e60 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -608,13 +608,14 @@ static int vqa_decode_frame_pal8(VqaContext *s, AVFrame *frame)
if (s->partial_countdown <= 0) {
bytestream2_init(&s->gb, s->next_codebook_buffer, s->next_codebook_buffer_index);
/* decompress codebook */
- if ((res = decode_format80(s, s->next_codebook_buffer_index,
- s->codebook, s->codebook_size, 0)) < 0)
- return res;
+ res = decode_format80(s, s->next_codebook_buffer_index,
+ s->codebook, s->codebook_size, 0);
/* reset accounting */
s->next_codebook_buffer_index = 0;
s->partial_countdown = s->partial_count;
+ if (res < 0)
+ return res;
}
}