[FFmpeg-devel] [PATCH] avcodec/cbs_av1: add a range check to tg_end

James Almer jamrial at gmail.com
Tue Oct 27 22:43:24 EET 2020


On 10/27/2020 5:09 PM, Mark Thompson wrote:
> On 27/10/2020 13:49, James Almer wrote:
>> Section 6.10.1 of the AV1 spec states:
>>
>> 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 at gmail.com>
>> ---
>>   libavcodec/cbs_av1_syntax_template.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/cbs_av1_syntax_template.c
>> b/libavcodec/cbs_av1_syntax_template.c
>> index 2df5619279..63b4db7853 100644
>> --- a/libavcodec/cbs_av1_syntax_template.c
>> +++ b/libavcodec/cbs_av1_syntax_template.c
>> @@ -1785,7 +1785,7 @@ static int
>> FUNC(tile_group_obu)(CodedBitstreamContext *ctx, RWContext *rw,
>>           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_end, current->tg_start,
>> MAX_UINT_BITS(tile_bits));
>>       }
>>         CHECK(FUNC(byte_alignment)(ctx, rw));
>>
> 
> This looks good.
> 
> I think the upper bound on tg_end can be num_tiles - 1 rather than
> accepting any value of tile_bits.  Can we sensibly bound tg_start as well?

We would need to keep track of the amount of tiles previous groups
contained. A field in CodedBitstreamAV1Context could work for that.

I'll try that and resend.

> 
> Thanks,
> 
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list