summaryrefslogtreecommitdiff
path: root/libavcodec/av1dec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-06-02 13:59:35 -0300
committerJames Almer <jamrial@gmail.com>2023-06-02 14:01:10 -0300
commit8c6b931f4ca08abdaff4896cb2707c38d8483d80 (patch)
treeca9dd3c6e4d94792835ce8287b3180f91eba9ecf /libavcodec/av1dec.c
parent9a9b56c8706957267c57a0c97db890b170b2bb9b (diff)
avcodec/av1dec: reset the fragment on reading failure
Fixes: NULL pointer dereference Fixes: 59359/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-6726080594313216 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1dec.c')
-rw-r--r--libavcodec/av1dec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 5cc5d87c64..d63e792113 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -1460,6 +1460,7 @@ static int av1_receive_frame(AVCodecContext *avctx, AVFrame *frame)
ret = ff_cbs_read_packet(s->cbc, &s->current_obu, s->pkt);
if (ret < 0) {
+ ff_cbs_fragment_reset(&s->current_obu);
av_packet_unref(s->pkt);
av_log(avctx, AV_LOG_ERROR, "Failed to read packet.\n");
return ret;