diff mbox series

[FFmpeg-devel] avcodec/sbcdec: Remove always-false check

Message ID GV1P250MB0737980E8C2AB0141BE171598F599@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 23411e6dcd3e610ac59cf6967c89115bcccb8d2e
Headers show
Series [FFmpeg-devel] avcodec/sbcdec: Remove always-false check | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 1, 2022, 3:46 p.m. UTC
We never guard against a user freeing/stealing the private context;
and returning AVERROR(EIO) is inappropriate.

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

Comments

Andreas Rheinhardt Oct. 3, 2022, 10 p.m. UTC | #1
Andreas Rheinhardt:
> We never guard against a user freeing/stealing the private context;
> and returning AVERROR(EIO) is inappropriate.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/sbcdec.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
> index 3fac2f5016..fd7c2e5e80 100644
> --- a/libavcodec/sbcdec.c
> +++ b/libavcodec/sbcdec.c
> @@ -343,9 +343,6 @@ static int sbc_decode_frame(AVCodecContext *avctx, AVFrame *frame,
>      SBCDecContext *sbc = avctx->priv_data;
>      int ret, frame_length;
>  
> -    if (!sbc)
> -        return AVERROR(EIO);
> -
>      frame_length = sbc_unpack_frame(avpkt->data, &sbc->frame, avpkt->size);
>      if (frame_length <= 0)
>          return frame_length;

Will apply this patch tonight unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index 3fac2f5016..fd7c2e5e80 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -343,9 +343,6 @@  static int sbc_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     SBCDecContext *sbc = avctx->priv_data;
     int ret, frame_length;
 
-    if (!sbc)
-        return AVERROR(EIO);
-
     frame_length = sbc_unpack_frame(avpkt->data, &sbc->frame, avpkt->size);
     if (frame_length <= 0)
         return frame_length;