aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-22 23:50:54 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-04-01 13:20:56 +0200
commita50aa980eb46ab7d291cb4645825405d26c843d0 (patch)
treef9f3b23e2e56dff3cb4255cc4046da4b1ffa2090
parent550d70fde3bdca6469193f8ae4a7ff2d03c2467a (diff)
downloadffmpeg-a50aa980eb46ab7d291cb4645825405d26c843d0.tar.gz
avcodec/vp9_superframe_split_bsf: Don't read inexistent data
Fixes: Out of array read Fixes: 45137/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_SUPERFRAME_SPLIT_fuzzer-4984270639202304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit d311d820a77550740d3b868440e476adaf12a872)
-rw-r--r--libavcodec/vp9_superframe_split_bsf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_superframe_split_bsf.c
index 7f0cad1ea0..c9cf21b541 100644
--- a/libavcodec/vp9_superframe_split_bsf.c
+++ b/libavcodec/vp9_superframe_split_bsf.c
@@ -51,6 +51,9 @@ static int vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)
return ret;
in = s->buffer_pkt;
+ if (!in->size)
+ goto passthrough;
+
marker = in->data[in->size - 1];
if ((marker & 0xe0) == 0xc0) {
int length_size = 1 + ((marker >> 3) & 0x3);
@@ -121,6 +124,7 @@ static int vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)
out->pts = AV_NOPTS_VALUE;
} else {
+passthrough:
av_packet_move_ref(out, s->buffer_pkt);
}