This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 6135ccbf80386083b89c3f1c194ee7482020f6ee
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Thu Apr 16 16:43:30 2026 +0200
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Mon Apr 20 12:54:31 2026 +0200

    avcodec/pdvenc: Return directly upon error
    
    This encoder has the FF_CODEC_CAP_INIT_CLEANUP cap set.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/pdvenc.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/libavcodec/pdvenc.c b/libavcodec/pdvenc.c
index 8334824067..af844623a9 100644
--- a/libavcodec/pdvenc.c
+++ b/libavcodec/pdvenc.c
@@ -57,24 +57,15 @@ static av_cold int encode_init(AVCodecContext *avctx)
     s->previous_frame = av_malloc(s->frame_size);
     s->work_frame     = av_malloc(s->frame_size);
     if (!s->previous_frame || !s->work_frame)
-        goto fail;
+        return AVERROR(ENOMEM);
 
     avctx->bits_per_coded_sample = 1;
 
-    ret = ff_deflate_init(&s->zstream,
-                          avctx->compression_level == FF_COMPRESSION_DEFAULT ?
-                          Z_DEFAULT_COMPRESSION :
-                          av_clip(avctx->compression_level, 0, 9),
-                          avctx);
-    if (ret < 0)
-        goto fail;
-
-    return 0;
-
-fail:
-    av_freep(&s->work_frame);
-    av_freep(&s->previous_frame);
-    return ret < 0 ? ret : AVERROR(ENOMEM);
+    return ff_deflate_init(&s->zstream,
+                           avctx->compression_level == FF_COMPRESSION_DEFAULT ?
+                           Z_DEFAULT_COMPRESSION :
+                           av_clip(avctx->compression_level, 0, 9),
+                           avctx);
 }
 
 static av_cold int encode_end(AVCodecContext *avctx)

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to