diff mbox series

[FFmpeg-devel,01/19] avcodec/vc1: Don't check for AVCodecContext.codec

Message ID GV1P250MB0737EF25F056808CC9F6896C8F349@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit fdcd3dcf2ed6ad72773e17d160d04c55af67201b
Headers show
Series [FFmpeg-devel,01/19] avcodec/vc1: Don't check for AVCodecContext.codec | 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 Oct. 30, 2022, 11:41 p.m. UTC
This check has been added in c617bed34f39a122ab1f89581ddce9cc63885383,
merging ee769c6a7c1d4ec6560f5e5a6f457b770b10fb33 to fix
a possible segfault if AVCodecContext.codec is not set
as it may be during parsing. While this fixes the segfault,
it has the unfortunate side effect that it makes the output
of the parser dependent on whether a decoder is set (and
ultimately available). The fix later applied in
5d2be71b9ecf2a88752666a2c4039f4d98419d35 does not have this
downside and makes checking AVCodecContext.codec superfluous.
So remove this check.

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

Comments

Andreas Rheinhardt Nov. 5, 2022, 5:18 p.m. UTC | #1
Andreas Rheinhardt:
> This check has been added in c617bed34f39a122ab1f89581ddce9cc63885383,
> merging ee769c6a7c1d4ec6560f5e5a6f457b770b10fb33 to fix
> a possible segfault if AVCodecContext.codec is not set
> as it may be during parsing. While this fixes the segfault,
> it has the unfortunate side effect that it makes the output
> of the parser dependent on whether a decoder is set (and
> ultimately available). The fix later applied in
> 5d2be71b9ecf2a88752666a2c4039f4d98419d35 does not have this
> downside and makes checking AVCodecContext.codec superfluous.
> So remove this check.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/vc1.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
> index c9257b290f..f6de8b9e75 100644
> --- a/libavcodec/vc1.c
> +++ b/libavcodec/vc1.c
> @@ -632,8 +632,6 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
>      v->fcm = PROGRESSIVE;
>      if (v->finterpflag)
>          v->interpfrm = get_bits1(gb);
> -    if (!v->s.avctx->codec)
> -        return -1;
>      if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
>          v->respic   =
>          v->rangered =

Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index c9257b290f..f6de8b9e75 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -632,8 +632,6 @@  int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
     v->fcm = PROGRESSIVE;
     if (v->finterpflag)
         v->interpfrm = get_bits1(gb);
-    if (!v->s.avctx->codec)
-        return -1;
     if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
         v->respic   =
         v->rangered =