X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fav1_parse.h;h=ae0ebb5a1850ade198c404e4c1d1faac99dedd3a;hb=0a071f7124beaf0929f772a8618ac1b6c17b0222;hp=864308f81da2a68723bc979deb4f0b71d3da8ccc;hpb=6fc762b4fd2c28ef7a0689a1df5ce200e5f5948f;p=ffmpeg diff --git a/libavcodec/av1_parse.h b/libavcodec/av1_parse.h index 864308f81da..ae0ebb5a185 100644 --- a/libavcodec/av1_parse.h +++ b/libavcodec/av1_parse.h @@ -27,6 +27,9 @@ #include "avcodec.h" #include "get_bits.h" +// OBU header fields + max leb128 length +#define MAX_OBU_HEADER_SIZE (2 + 8) + typedef struct AV1OBU { /** Size of payload */ int size; @@ -56,6 +59,7 @@ typedef struct AV1Packet { AV1OBU *obus; int nb_obus; int obus_allocated; + unsigned obus_allocated_size; } AV1Packet; /** @@ -104,7 +108,7 @@ static inline int parse_obu_header(const uint8_t *buf, int buf_size, int ret, extension_flag, has_size_flag; int64_t size; - ret = init_get_bits8(&gb, buf, FFMIN(buf_size, 2 + 8)); // OBU header fields + max leb128 length + ret = init_get_bits8(&gb, buf, FFMIN(buf_size, MAX_OBU_HEADER_SIZE)); if (ret < 0) return ret; @@ -145,7 +149,9 @@ static inline int get_obu_bit_length(const uint8_t *buf, int size, int type) int v; /* There are no trailing bits on these */ - if (type == AV1_OBU_TILE_GROUP || type == AV1_OBU_FRAME) { + if (type == AV1_OBU_TILE_GROUP || + type == AV1_OBU_TILE_LIST || + type == AV1_OBU_FRAME) { if (size > INT_MAX / 8) return AVERROR(ERANGE); else