diff mbox series

[FFmpeg-devel,2/4] avcodec/vvc_parser: Constify parser

Message ID AS8P250MB0744F6282DC26DDABA476F068F25A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 22c47b10b28c0c47298d34a7108d378be5d7d08e
Headers show
Series [FFmpeg-devel,1/4] avcodec/cbs_h266: Remove double ; | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt June 29, 2023, 6:19 p.m. UTC
The discrepancy between the definition and the declaration
in parsers.c is actually UB.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/vvc_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer June 29, 2023, 6:19 p.m. UTC | #1
On 6/29/2023 3:19 PM, Andreas Rheinhardt wrote:
> The discrepancy between the definition and the declaration
> in parsers.c is actually UB.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>   libavcodec/vvc_parser.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vvc_parser.c b/libavcodec/vvc_parser.c
> index 4f7657f7ab..f350fe70a9 100644
> --- a/libavcodec/vvc_parser.c
> +++ b/libavcodec/vvc_parser.c
> @@ -571,7 +571,7 @@ static void vvc_parser_close(AVCodecParserContext *s)
>       av_freep(&ctx->pc.buffer);
>   }
>   
> -AVCodecParser ff_vvc_parser = {
> +const AVCodecParser ff_vvc_parser = {
>       .codec_ids      = { AV_CODEC_ID_VVC },
>       .priv_data_size = sizeof(VVCParserContext),
>       .parser_init    = vvc_parser_init,

LGTM.
diff mbox series

Patch

diff --git a/libavcodec/vvc_parser.c b/libavcodec/vvc_parser.c
index 4f7657f7ab..f350fe70a9 100644
--- a/libavcodec/vvc_parser.c
+++ b/libavcodec/vvc_parser.c
@@ -571,7 +571,7 @@  static void vvc_parser_close(AVCodecParserContext *s)
     av_freep(&ctx->pc.buffer);
 }
 
-AVCodecParser ff_vvc_parser = {
+const AVCodecParser ff_vvc_parser = {
     .codec_ids      = { AV_CODEC_ID_VVC },
     .priv_data_size = sizeof(VVCParserContext),
     .parser_init    = vvc_parser_init,