From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 153C144560 for ; Thu, 15 Sep 2022 18:43:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 16B6068BBB3; Thu, 15 Sep 2022 21:43:07 +0300 (EEST) Received: from shout01.mail.de (shout01.mail.de [62.201.172.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C90568BAA7 for ; Thu, 15 Sep 2022 21:43:00 +0300 (EEST) Received: from postfix03.mail.de (postfix03.bt.mail.de [10.0.121.127]) by shout01.mail.de (Postfix) with ESMTP id 985AAA0605 for ; Thu, 15 Sep 2022 20:42:59 +0200 (CEST) Received: from smtp04.mail.de (smtp04.bt.mail.de [10.0.121.214]) by postfix03.mail.de (Postfix) with ESMTP id 7FEA7800F5 for ; Thu, 15 Sep 2022 20:42:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1663267379; bh=G4/oHoy2Zt16SdLvn4cu1DydBwKs4X/AfLNG0RAMLts=; h=From:To:Subject:Date:Message-Id:From:To:CC:Subject:Reply-To; b=Aq+He0kltjJh06iYkaxOY58CYr8msLSCXvi1i3zuEPidZpAl+eCwtwmtIogJVowKQ LxLgDtmlQ3f3QhfHj8lbkaOGOVB3aiH74pB7o+l4NAXttza3pSxbm9rDHJxR6j6DNx fBA+ePKFBIxFXUHxnDEf4bvJOKoIE2qgdUF6XdQMn74W+f3kkTIoN7RXGIxKA9qS8c +3Pz6d8zH+GMJc/1rTNZUCcc8S4NPrQaGkwkUu61vE8UD4xCknuGWTkKWKKbA7eQ/c UKk+l6vMLSgtdY64bPtvYAkVRwNJhFLPsk+m+e3OAgyxsRBHWJqGNkF8TPAOzBt30u WRl3SF6XObnsQ== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp04.mail.de (Postfix) with ESMTPSA id 3B3CFC0040 for ; Thu, 15 Sep 2022 20:42:59 +0200 (CEST) From: Thilo Borgmann To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Sep 2022 20:42:58 +0200 Message-Id: <20220915184258.85103-1-thilo.borgmann@mail.de> MIME-Version: 1.0 X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1184 X-purgate-ID: 154282::1663267379-000016C9-6BD7E39D/0/0 Subject: [FFmpeg-devel] [PATCH] lavc/videotoolboxenc: Fix crash by uninitialized value X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: If create_cv_pixel_buffer() fails, pixel_buffer_info might get into CFRelease() containing an arbitrary value. --- libavcodec/videotoolboxenc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index bb3065d1d5..dc9e321d3d 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -1440,7 +1440,7 @@ static int vtenc_create_encoder(AVCodecContext *avctx, static int vtenc_configure_encoder(AVCodecContext *avctx) { CFMutableDictionaryRef enc_info; - CFMutableDictionaryRef pixel_buffer_info; + CFMutableDictionaryRef pixel_buffer_info = NULL; CMVideoCodecType codec_type; VTEncContext *vtctx = avctx->priv_data; CFStringRef profile_level = NULL; @@ -1517,8 +1517,6 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info); if (status) goto init_cleanup; - } else { - pixel_buffer_info = NULL; } vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0; -- 2.20.1 (Apple Git-117) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".