diff mbox series

[FFmpeg-devel,3/3] avcodec/smacker: Add FF_CODEC_CAP_INIT_CLEANUP

Message ID 20200626202822.17751-3-andreas.rheinhardt@gmail.com
State Accepted
Commit b146a61c226321a3c6d70d240a36c800e7795400
Headers show
Series [FFmpeg-devel,1/3] avcodec/bitstream: Don't check for undefined behaviour after it happened
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 26, 2020, 8:28 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/smacker.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andreas Rheinhardt June 29, 2020, 10:50 a.m. UTC | #1
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/smacker.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
> index b4c463b4b9..9f054f071d 100644
> --- a/libavcodec/smacker.c
> +++ b/libavcodec/smacker.c
> @@ -600,13 +600,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
>      /* decode huffman trees from extradata */
>      if(avctx->extradata_size < 16){
>          av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n");
> -        decode_end(avctx);
>          return AVERROR(EINVAL);
>      }
>  
>      ret = decode_header_trees(c);
>      if (ret < 0) {
> -        decode_end(avctx);
>          return ret;
>      }
>  
> @@ -840,6 +838,7 @@ AVCodec ff_smacker_decoder = {
>      .close          = decode_end,
>      .decode         = decode_frame,
>      .capabilities   = AV_CODEC_CAP_DR1,
> +    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
>  };
>  
>  AVCodec ff_smackaud_decoder = {
> 
Will apply tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index b4c463b4b9..9f054f071d 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -600,13 +600,11 @@  static av_cold int decode_init(AVCodecContext *avctx)
     /* decode huffman trees from extradata */
     if(avctx->extradata_size < 16){
         av_log(avctx, AV_LOG_ERROR, "Extradata missing!\n");
-        decode_end(avctx);
         return AVERROR(EINVAL);
     }
 
     ret = decode_header_trees(c);
     if (ret < 0) {
-        decode_end(avctx);
         return ret;
     }
 
@@ -840,6 +838,7 @@  AVCodec ff_smacker_decoder = {
     .close          = decode_end,
     .decode         = decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };
 
 AVCodec ff_smackaud_decoder = {