diff mbox series

[FFmpeg-devel,11/36] avcodec/vp9_raw_reorder_bsf: Check for existence of data before reading it

Message ID 20200530160541.29517-11-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/36] avcodec/vp9_superframe_bsf: Check for existence of data before reading it | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 30, 2020, 4:05 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/vp9_raw_reorder_bsf.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/vp9_raw_reorder_bsf.c b/libavcodec/vp9_raw_reorder_bsf.c
index 6562399159..6e77816256 100644
--- a/libavcodec/vp9_raw_reorder_bsf.c
+++ b/libavcodec/vp9_raw_reorder_bsf.c
@@ -292,6 +292,11 @@  static int vp9_raw_reorder_filter(AVBSFContext *bsf, AVPacket *out)
             return err;
         }
 
+        if (in->size <= 0) {
+            av_packet_free(&in);
+            return AVERROR_INVALIDDATA;
+        }
+
         if ((in->data[in->size - 1] & 0xe0) == 0xc0) {
             av_log(bsf, AV_LOG_ERROR, "Input in superframes is not "
                    "supported.\n");