diff mbox series

[FFmpeg-devel,4/4] avcodec/videotoolboxenc: use goto end for memory cleanup

Message ID 1633703633-18164-4-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 871fee82e18442b419841234b6722e5b6c3aebcc
Headers show
Series [FFmpeg-devel,1/4] avcodec/audiotoolboxdec: Fix usage of init_get_bits() and use init_get_bits8() | expand

Checks

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

Commit Message

Lance Wang Oct. 8, 2021, 2:33 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/videotoolboxenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 93c3898..bac36fd 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -876,7 +876,7 @@  static int create_cv_pixel_buffer_info(AVCodecContext* avctx,
     width_num = CFNumberCreate(kCFAllocatorDefault,
                                kCFNumberSInt32Type,
                                &avctx->width);
-    if (!width_num) return AVERROR(ENOMEM);
+    if (!width_num) goto pbinfo_nomem;
 
     CFDictionarySetValue(pixel_buffer_info,
                          kCVPixelBufferWidthKey,