ffmpeg | branch: master | Linjie Fu <linjie...@intel.com> | Tue Feb 25 10:02:33 
2020 +0800| [c39b6e1425f041622a4e58d1c7c215c75a04a845] | committer: Haihao Xiang

lavc/qsvenc: add return check for ff_qsv_map_pixfmt

Return an error directly if pixfmt is not supported for encoding, otherwise
it may be hidden until query/check in MSDK.

Signed-off-by: Linjie Fu <linjie...@intel.com>
Signed-off-by: Haihao Xiang <haihao.xi...@intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c39b6e1425f041622a4e58d1c7c215c75a04a845
---

 libavcodec/qsvenc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 602436da63..4e7a15f060 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -578,7 +578,9 @@ static int init_video_param_jpeg(AVCodecContext *avctx, 
QSVEncContext *q)
     if (!desc)
         return AVERROR_BUG;
 
-    ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC);
+    ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC);
+    if (ret < 0)
+        return AVERROR_BUG;
 
     q->param.mfx.FrameInfo.CropX          = 0;
     q->param.mfx.FrameInfo.CropY          = 0;
@@ -681,7 +683,9 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
     if (!desc)
         return AVERROR_BUG;
 
-    ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC);
+    ret = ff_qsv_map_pixfmt(sw_format, &q->param.mfx.FrameInfo.FourCC);
+    if (ret < 0)
+        return AVERROR_BUG;
 
     q->param.mfx.FrameInfo.CropX          = 0;
     q->param.mfx.FrameInfo.CropY          = 0;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to