diff mbox series

[FFmpeg-devel] lavfi/dnn/dnn_io_proc.c: fix CID 1484955

Message ID 20210529132419.18027-1-yejun.guo@intel.com
State Accepted
Commit 3ac7d994280e913f41a246014d3cfb76070a6f3e
Headers show
Series [FFmpeg-devel] lavfi/dnn/dnn_io_proc.c: fix CID 1484955 | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Guo, Yejun May 29, 2021, 1:24 p.m. UTC
CID 1484955:  Memory - corruptions  (ARRAY_VS_SINGLETON)
---
 libavfilter/dnn/dnn_io_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guo, Yejun June 4, 2021, 6:49 a.m. UTC | #1
> -----Original Message-----
> From: Guo, Yejun <yejun.guo@intel.com>
> Sent: 2021年5月29日 21:24
> To: ffmpeg-devel@ffmpeg.org
> Cc: Guo, Yejun <yejun.guo@intel.com>
> Subject: [PATCH] lavfi/dnn/dnn_io_proc.c: fix CID 1484955
> 
> CID 1484955:  Memory - corruptions  (ARRAY_VS_SINGLETON)
> ---
>  libavfilter/dnn/dnn_io_proc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/dnn/dnn_io_proc.c b/libavfilter/dnn/dnn_io_proc.c
> index 021d004e1d..f55424d97c 100644
> --- a/libavfilter/dnn/dnn_io_proc.c
> +++ b/libavfilter/dnn/dnn_io_proc.c
> @@ -128,7 +128,7 @@ DNNReturnType
> ff_proc_from_frame_to_dnn(AVFrame *frame, DNNData *input, void *lo
>          }
>          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 * 3 * sizeof(float),
> 0, 0, 0});
>          sws_freeContext(sws_ctx);
>          break;
will push tomorrow if there's no objection.
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_io_proc.c b/libavfilter/dnn/dnn_io_proc.c
index 021d004e1d..f55424d97c 100644
--- a/libavfilter/dnn/dnn_io_proc.c
+++ b/libavfilter/dnn/dnn_io_proc.c
@@ -128,7 +128,7 @@  DNNReturnType ff_proc_from_frame_to_dnn(AVFrame *frame, DNNData *input, void *lo
         }
         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 * 3 * sizeof(float), 0, 0, 0});
         sws_freeContext(sws_ctx);
         break;