Commit 4e937b1a authored by James Almer's avatar James Almer

avcodec/av1_parse: check for OBU header overread

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent e45ed155
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment