Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] lavc/videotoolbox: validate vt context in the decoder callback
@ 2022-11-27 17:33 Alessandro Di Nepi
  2022-11-29 16:46 ` Alessandro Di Nepi
  0 siblings, 1 reply; 14+ messages in thread
From: Alessandro Di Nepi @ 2022-11-27 17:33 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Alessandro Di Nepi

The commit d7f4ad88a0df3c1339e142957bf2c40cd056b8ce introduced a race
condition where the passed opaque pointer reference might be NULL,
when the decoding process starts.
This patch checks that vtctx has a value before accessing it.

This patch fixes #10079.

Signed-off-by: Alessandro Di Nepi <alessandro.dinepi@gmail.com>
---
 libavcodec/videotoolbox.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 1b1be8ddb4..615e2b087a 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -692,6 +692,11 @@ static void videotoolbox_decoder_callback(void *opaque,
 {
     VTContext *vtctx = opaque;
 
+    if (!vtctx) {
+        av_log(NULL, AV_LOG_WARNING, "vt decoder cb: vt context is null");
+        return;
+    }
+
     if (vtctx->frame) {
         CVPixelBufferRelease(vtctx->frame);
         vtctx->frame = NULL;
-- 
2.37.1 (Apple Git-137.1)

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-01-09 14:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <53dafc80-d9f6-4b5b-a7a5-781bbb045493@Spark>
2022-11-27 16:21 ` [FFmpeg-devel] [PATCH] lavc/videotoolbox: validate vt context in the decoder callback Alessandro Di Nepi
2022-11-27 17:33 Alessandro Di Nepi
2022-11-29 16:46 ` Alessandro Di Nepi
2022-12-04 14:02   ` Alessandro Di Nepi
2022-12-04 15:00   ` Rick Kern
2022-12-04 17:51     ` Alessandro Di Nepi
2022-12-05 13:36       ` Rick Kern
2022-12-06  5:19         ` "zhilizhao(赵志立)"
2022-12-06 16:30           ` Alessandro Di Nepi
2022-12-09  4:44             ` "zhilizhao(赵志立)"
2022-12-11  9:57               ` Alessandro Di Nepi
2022-12-15 14:16                 ` Alessandro Di Nepi
2022-12-15 14:45                   ` Zhao Zhili
2023-01-09 14:48                   ` Zhao Zhili

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