diff mbox

[FFmpeg-devel] avcodec/cbs_av1: fix range of allowed values for obu_type

Message ID 20190324222848.5740-1-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer March 24, 2019, 10:28 p.m. UTC
0 is a reserved value.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/cbs_av1_syntax_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Thompson April 1, 2019, 10:37 p.m. UTC | #1
On 24/03/2019 22:28, James Almer wrote:
> 0 is a reserved value.
> 
> Signed-off-by: James Almer <jamrial@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 76eb90b279..35b030208b 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -26,7 +26,7 @@ static int FUNC(obu_header)(CodedBitstreamContext *ctx, RWContext *rw,
>  
>      fc(1, obu_forbidden_bit, 0, 0);
>  
> -    fc(4, obu_type, 0, AV1_OBU_PADDING);
> +    fc(4, obu_type, AV1_OBU_SEQUENCE_HEADER, AV1_OBU_PADDING);
>      flag(obu_extension_flag);
>      flag(obu_has_size_field);
>  
> 

Seems fine, but I'm not sure whether it is useful to distinguish 0 from the other reserved values (9-14) as invalid at this stage?  They will all pass through and return ENOSYS later when we come to read/write the content anyway.

(LGTM if you feel strongly.)

Thanks,

- Mark
diff mbox

Patch

diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 76eb90b279..35b030208b 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -26,7 +26,7 @@  static int FUNC(obu_header)(CodedBitstreamContext *ctx, RWContext *rw,
 
     fc(1, obu_forbidden_bit, 0, 0);
 
-    fc(4, obu_type, 0, AV1_OBU_PADDING);
+    fc(4, obu_type, AV1_OBU_SEQUENCE_HEADER, AV1_OBU_PADDING);
     flag(obu_extension_flag);
     flag(obu_has_size_field);