From: Thilo Borgmann <thilo.borgmann@mail.de>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] lavc/videotoolboxenc: Fix crash by uninitialized value
Date: Wed, 21 Sep 2022 13:41:23 +0200
Message-ID: <5a16be9d-2a07-67e2-eed3-b030109f7541@mail.de> (raw)
In-Reply-To: <20220915184258.85103-1-thilo.borgmann@mail.de>
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".
prev parent reply other threads:[~2022-09-21 11:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 18:42 Thilo Borgmann
2022-09-21 11:41 ` Thilo Borgmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5a16be9d-2a07-67e2-eed3-b030109f7541@mail.de \
--to=thilo.borgmann@mail.de \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git