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] qsv: add return value check for MFXQueryIMPL
@ 2022-02-24  2:27 Tong Wu
  2022-02-24  2:27 ` [FFmpeg-devel] [PATCH] qsvenc: avoid dereferencing the null pointer Tong Wu
  2022-02-28  6:39 ` [FFmpeg-devel] [PATCH] qsv: add return value check for MFXQueryIMPL Xiang, Haihao
  0 siblings, 2 replies; 4+ messages in thread
From: Tong Wu @ 2022-02-24  2:27 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Tong Wu

add a return value check for function MFXQueryIMPL to handle the error
message.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
---
 libavcodec/qsv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 1a432dbd82..18f34f05fd 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -408,7 +408,10 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs,
         return ret;
     }
 
-    MFXQueryIMPL(qs->session, &impl);
+    ret = MFXQueryIMPL(qs->session, &impl);
+    if (ret != MFX_ERR_NONE)
+        return ff_qsv_print_error(avctx, ret,
+                                  "Error querying the session attributes");
 
     switch (MFX_IMPL_BASETYPE(impl)) {
     case MFX_IMPL_SOFTWARE:
-- 
2.16.1.windows.4

_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2022-02-28  6:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  2:27 [FFmpeg-devel] [PATCH] qsv: add return value check for MFXQueryIMPL Tong Wu
2022-02-24  2:27 ` [FFmpeg-devel] [PATCH] qsvenc: avoid dereferencing the null pointer Tong Wu
2022-02-28  6:39   ` Xiang, Haihao
2022-02-28  6:39 ` [FFmpeg-devel] [PATCH] qsv: add return value check for MFXQueryIMPL Xiang, Haihao

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