[FFmpeg-devel] [PATCH 01/36] avcodec/vp9_superframe_bsf: Check for existence of data before reading it
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Sat May 30 19:05:06 EEST 2020
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
libavcodec/vp9_superframe_bsf.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index 57681e29e4..34a47aa69e 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -108,6 +108,11 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt)
if (res < 0)
return res;
+ if (pkt->size <= 0) {
+ res = AVERROR_INVALIDDATA;
+ goto done;
+ }
+
marker = pkt->data[pkt->size - 1];
if ((marker & 0xe0) == 0xc0) {
int nbytes = 1 + ((marker >> 3) & 0x3);
--
2.20.1
More information about the ffmpeg-devel
mailing list