Browse Source

avcodec/av1_parse: check for OBU header overread

Signed-off-by: James Almer <jamrial@gmail.com>
tags/n4.1
James Almer 7 years ago
parent
commit
4e937b1a60
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/av1_parse.h

+ 4
- 0
libavcodec/av1_parse.h View File

@@ -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;


Loading…
Cancel
Save