Skip to content

Commit

Permalink
avcodec/av1_parse: use macro for MAX_OBU_HEADER_SIZE
Browse files Browse the repository at this point in the history
Signed-off-by: James Almer <[email protected]>
  • Loading branch information
xuguangxin authored and jamrial committed Aug 14, 2020
1 parent 3c05c8a commit 6a941b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libavcodec/av1_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -105,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;

Expand Down

0 comments on commit 6a941b5

Please sign in to comment.