diff mbox series

[FFmpeg-devel,13/13] avcodec/truemotion1: Cleanup generically after init failure

Message ID 20200829175626.11682-13-andreas.rheinhardt@gmail.com
State Accepted
Commit 9372eb00c8a1d4f2f1a356609bdcec207063baf5
Headers show
Series [FFmpeg-devel,01/13] avcodec/cinepakenc: Cleanup generically after init failure | expand

Checks

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

Commit Message

Andreas Rheinhardt Aug. 29, 2020, 5:56 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/truemotion1.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Paul B Mahol Aug. 29, 2020, 6:07 p.m. UTC | #1
On 8/29/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/truemotion1.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>

LGTM
diff mbox series

Patch

diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index b6481cbd7c..94782fef4b 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -491,10 +491,8 @@  static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
     /* there is a vertical predictor for each pixel in a line; each vertical
      * predictor is 0 to start with */
     av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
-    if (!s->vert_pred) {
-        av_frame_free(&s->frame);
+    if (!s->vert_pred)
         return AVERROR(ENOMEM);
-    }
 
     return 0;
 }
@@ -922,4 +920,5 @@  AVCodec ff_truemotion1_decoder = {
     .close          = truemotion1_decode_end,
     .decode         = truemotion1_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };