diff options
author | Guo, Yejun <yejun.guo@intel.com> | 2021-05-11 14:05:18 +0800 |
---|---|---|
committer | Guo, Yejun <yejun.guo@intel.com> | 2021-05-18 09:20:08 +0800 |
commit | 4718d74c5888457bca49aa02187841905e259d57 (patch) | |
tree | 904fbb8894209ddf61e723a988ce1ddfbbcb20f6 | |
parent | 3fb1d2e71c1c92ce282b373cd0319bfec56be2db (diff) | |
download | ffmpeg-4718d74c5888457bca49aa02187841905e259d57.tar.gz |
lavfi/vf_dnn_processing.c: fix CID 1460603
CID 1460603 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS)
-rw-r--r-- | libavfilter/vf_dnn_processing.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c index e05d59a649..e1d9d24683 100644 --- a/libavfilter/vf_dnn_processing.c +++ b/libavfilter/vf_dnn_processing.c @@ -225,6 +225,9 @@ static int copy_uv_planes(DnnProcessingContext *ctx, AVFrame *out, const AVFrame uv_height = AV_CEIL_RSHIFT(in->height, desc->log2_chroma_h); for (int i = 1; i < 3; ++i) { int bytewidth = av_image_get_linesize(in->format, in->width, i); + if (bytewidth < 0) { + return AVERROR(EINVAL); + } av_image_copy_plane(out->data[i], out->linesize[i], in->data[i], in->linesize[i], bytewidth, uv_height); |