diff options
author | James Almer <jamrial@gmail.com> | 2018-07-30 15:14:24 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-08-02 12:41:54 -0300 |
commit | 692e323d893190051c488931bf15eb5c7d340f74 (patch) | |
tree | c75c2d1aa236732a48576a481a3abade6b3cf7d1 /libavcodec/av1_parse.c | |
parent | 1e126560c2792e2e141167fb138d6ad1bfed7b39 (diff) | |
download | ffmpeg-692e323d893190051c488931bf15eb5c7d340f74.tar.gz |
avcodec/av1_parse: return size of the parsed OBU in parse_obu_header()
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1_parse.c')
-rw-r--r-- | libavcodec/av1_parse.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libavcodec/av1_parse.c b/libavcodec/av1_parse.c index 48feb9fb8a..50dd940f03 100644 --- a/libavcodec/av1_parse.c +++ b/libavcodec/av1_parse.c @@ -29,11 +29,12 @@ int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx { int64_t obu_size; int start_pos, type, temporal_id, spatial_id; + int len, ret; - int ret = parse_obu_header(buf, length, &obu_size, &start_pos, - &type, &temporal_id, &spatial_id); - if (ret < 0) - return ret; + len = parse_obu_header(buf, length, &obu_size, &start_pos, + &type, &temporal_id, &spatial_id); + if (len < 0) + return len; if (obu_size > INT_MAX / 8 || obu_size < 0) return AVERROR(ERANGE); @@ -42,12 +43,10 @@ int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx obu->temporal_id = temporal_id; obu->spatial_id = spatial_id; - length = obu_size + start_pos; - obu->data = buf + start_pos; obu->size = obu_size; obu->raw_data = buf; - obu->raw_size = length; + obu->raw_size = len; ret = init_get_bits(&obu->gb, obu->data, obu->size * 8); if (ret < 0) @@ -57,7 +56,7 @@ int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, void *logctx "obu_type: %d, temporal_id: %d, spatial_id: %d, payload size: %d\n", obu->type, obu->temporal_id, obu->spatial_id, obu->size); - return length; + return len; } int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, void *logctx) |