You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/av1_parse: check for OBU header overread
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -118,6 +118,10 @@ static inline int parse_obu_header(const uint8_t *buf, int buf_size,
|
|||||||
|
|
||||||
*obu_size = has_size_flag ? leb128(&gb)
|
*obu_size = has_size_flag ? leb128(&gb)
|
||||||
: buf_size - 1 - extension_flag;
|
: buf_size - 1 - extension_flag;
|
||||||
|
|
||||||
|
if (get_bits_left(&gb) < 0)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
*start_pos = get_bits_count(&gb) / 8;
|
*start_pos = get_bits_count(&gb) / 8;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user