[FFmpeg-cvslog] avcodec/av1_parse: check for OBU header overread

James Almer git at videolan.org
Thu Aug 2 21:02:44 EEST 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Jul 23 13:12:43 2018 -0300| [4e937b1a60e239335df7623af5eeaa8dd534ee0b] | committer: James Almer

avcodec/av1_parse: check for OBU header overread

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e937b1a60e239335df7623af5eeaa8dd534ee0b
---

 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;



More information about the ffmpeg-cvslog mailing list