summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_av1_syntax_template.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-10-27 18:25:06 -0300
committerJames Almer <jamrial@gmail.com>2020-11-11 10:23:01 -0300
commita876bc9c17e4d50e8cb9033c78300944adb6231a (patch)
treedaf74a1a7a370c9e0432a27a1328c558686c538e /libavcodec/cbs_av1_syntax_template.c
parentddb0e4fecdef24e8c7b90fa0a41d13e642ea732f (diff)
avcodec/cbs_av1: add a range check to tg_end
Section 6.10.1 of the AV1 spec states: It is a requirement of bitstream conformance that the value of tg_start is equal to the value of TileNum at the point that tile_group_obu is invoked. It is a requirement of bitstream conformance that the value of tg_end is greater than or equal to tg_start. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/cbs_av1_syntax_template.c')
-rw-r--r--libavcodec/cbs_av1_syntax_template.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 884dbec760..bef53e145b 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1725,6 +1725,8 @@ static int FUNC(frame_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(uncompressed_header)(ctx, rw, current));
+ priv->tile_num = 0;
+
if (current->show_existing_frame) {
priv->seen_frame_header = 0;
} else {
@@ -1790,10 +1792,12 @@ static int FUNC(tile_group_obu)(CodedBitstreamContext *ctx, RWContext *rw,
} else {
tile_bits = cbs_av1_tile_log2(1, priv->tile_cols) +
cbs_av1_tile_log2(1, priv->tile_rows);
- fb(tile_bits, tg_start);
- fb(tile_bits, tg_end);
+ fc(tile_bits, tg_start, priv->tile_num, num_tiles - 1);
+ fc(tile_bits, tg_end, current->tg_start, num_tiles - 1);
}
+ priv->tile_num = current->tg_end + 1;
+
CHECK(FUNC(byte_alignment)(ctx, rw));
// Reset header for next frame.