Signed-off-by: James Almer <jamr...@gmail.com>
---
 libavcodec/av1_parse.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/av1_parse.h b/libavcodec/av1_parse.h
index 84fc71c925..3a4151491a 100644
--- a/libavcodec/av1_parse.h
+++ b/libavcodec/av1_parse.h
@@ -118,6 +118,10 @@ static inline int parse_obu_header(const uint8_t *buf, int 
buf_size,
 
     *obu_size  = has_size_flag ? leb128(&gb)
                                : buf_size - 1 - extension_flag;
+
+    if (get_bits_left(&gb) < 0)
+        return AVERROR_INVALIDDATA;
+
     *start_pos = get_bits_count(&gb) / 8;
 
     return 0;
-- 
2.18.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to