aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/dnn
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2021-05-11 12:31:02 +0800
committerGuo, Yejun <yejun.guo@intel.com>2021-05-18 09:20:08 +0800
commitbd6ea9ed1d7110601a83722b94c5a2d66feb511d (patch)
treee1eed0a83aee3e6802cf76ba26fb0a4410fd5c3c /libavfilter/dnn
parent11b489d592553da3d5e61a83482ee188005b0da9 (diff)
downloadffmpeg-bd6ea9ed1d7110601a83722b94c5a2d66feb511d.tar.gz
lavfi/dnn/dnn_io_proc.c: Fix Out-of-bounds access (ARRAY_VS_SINGLETON)
fix coverity CID 1473571, 1473577 and 1482089
Diffstat (limited to 'libavfilter/dnn')
-rw-r--r--libavfilter/dnn/dnn_io_proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/dnn/dnn_io_proc.c b/libavfilter/dnn/dnn_io_proc.c
index 1e2bef3f9a..d5d2654162 100644
--- a/libavfilter/dnn/dnn_io_proc.c
+++ b/libavfilter/dnn/dnn_io_proc.c
@@ -154,7 +154,7 @@ static DNNReturnType proc_from_frame_to_dnn_frameprocessing(AVFrame *frame, DNND
}
sws_scale(sws_ctx, (const uint8_t **)frame->data,
frame->linesize, 0, frame->height,
- (uint8_t * const*)(&input->data),
+ (uint8_t * const [4]){input->data, 0, 0, 0},
(const int [4]){frame->width * sizeof(float), 0, 0, 0});
sws_freeContext(sws_ctx);
break;
@@ -236,7 +236,7 @@ DNNReturnType ff_frame_to_dnn_classify(AVFrame *frame, DNNData *input, uint32_t
sws_scale(sws_ctx, (const uint8_t *const *)&bbox_data, frame->linesize,
0, height,
- (uint8_t *const *)(&input->data), linesizes);
+ (uint8_t *const [4]){input->data, 0, 0, 0}, linesizes);
sws_freeContext(sws_ctx);
@@ -266,7 +266,7 @@ static DNNReturnType proc_from_frame_to_dnn_analytics(AVFrame *frame, DNNData *i
}
sws_scale(sws_ctx, (const uint8_t *const *)frame->data, frame->linesize, 0, frame->height,
- (uint8_t *const *)(&input->data), linesizes);
+ (uint8_t *const [4]){input->data, 0, 0, 0}, linesizes);
sws_freeContext(sws_ctx);
return DNN_SUCCESS;