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 14297446F8 for ; Wed, 21 Sep 2022 11:41:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5780768BB8A; Wed, 21 Sep 2022 14:41:31 +0300 (EEST) Received: from shout02.mail.de (shout02.mail.de [62.201.172.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9CE9D68BAAA for ; Wed, 21 Sep 2022 14:41:25 +0300 (EEST) Received: from postfix03.mail.de (postfix03.bt.mail.de [10.0.121.127]) by shout02.mail.de (Postfix) with ESMTP id 18A78A0C15 for ; Wed, 21 Sep 2022 13:41:25 +0200 (CEST) Received: from smtp03.mail.de (smtp03.bt.mail.de [10.0.121.213]) by postfix03.mail.de (Postfix) with ESMTP id F1E3E8020A for ; Wed, 21 Sep 2022 13:41:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1663760485; bh=/gCj4M2D5xpPXIDkxQVNLqcVhuLYd9rbiUGHPNdL06Y=; h=Message-ID:Date:Subject:To:From:From:To:CC:Subject:Reply-To; b=pGDErTrTbFNQ4c0dyJIIBkVkzIgv+H8Ox6HYeKwdrlqNejef3oE2DwvZKn8pvaMXS xp2Sy8lq7X3FXSIZ1Yfh9atJJbWsYE/2pSWjPF/meuSldtSTEEOsHRWsOq+7CIGvXt +DP5fuD6F8IEEjOBeyEM3oihfY1dCH0o2nTvT021hdON5h3GhmO6nm7M5Hv6a1I3aO E0JiotGcmpvJlMSgT/QXuSvUuRpVYZkN1GG6FB1HV5tIkQ3idaspyJrA4EXWbyRnxM KuxvqUBZeYUXo8zMCDR6TujqIDPGa5oKwTILXL/XZ31+s1P3bIACQrWyOn/1ZEtpAl ccrupw3noC4hQ== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtp03.mail.de (Postfix) with ESMTPSA id BECC0A0327 for ; Wed, 21 Sep 2022 13:41:24 +0200 (CEST) Message-ID: <5a16be9d-2a07-67e2-eed3-b030109f7541@mail.de> Date: Wed, 21 Sep 2022 13:41:23 +0200 MIME-Version: 1.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220915184258.85103-1-thilo.borgmann@mail.de> From: Thilo Borgmann In-Reply-To: <20220915184258.85103-1-thilo.borgmann@mail.de> 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: 1321 X-purgate-ID: 154282::1663760484-1EFF925E-DC2BDEF8/0/0 Subject: Re: [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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Am 15.09.22 um 20:42 schrieb Thilo Borgmann: > 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; LGTM's by ePirat on IRC. Pushed. Thanks, Thilo _______________________________________________ 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".