[FFmpeg-devel] [PATCH] lavc/qsvenc: add return check for ff_qsv_map_pixfmt
Linjie Fu
linjie.fu at intel.com
Tue Feb 25 04:02:33 EET 2020
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.fu at intel.com>
---
libavcodec/qsvenc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 571a711..40ff17c 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -436,7 +436,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;
@@ -537,7 +539,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;
--
2.7.4
More information about the ffmpeg-devel
mailing list