You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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.fu@intel.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user