diff mbox series

[FFmpeg-devel] dnn/dnn_backend_native_layer_conv2d: Fix allocation size

Message ID 20200909121213.12451-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 9beaf536fe5b52ed5af4d4dd5746277ee5ac9552
Headers show
Series [FFmpeg-devel] dnn/dnn_backend_native_layer_conv2d: Fix allocation size | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 9, 2020, 12:12 p.m. UTC
Found via ASAN with the dnn-layer-conv2d FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
Will apply this soon.

 libavfilter/dnn/dnn_backend_native_layer_conv2d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guo, Yejun Sept. 9, 2020, 12:54 p.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Andreas Rheinhardt
> Sent: 2020年9月9日 20:12
> To: ffmpeg-devel@ffmpeg.org
> Cc: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> Subject: [FFmpeg-devel] [PATCH] dnn/dnn_backend_native_layer_conv2d: Fix
> allocation size
> 
> Found via ASAN with the dnn-layer-conv2d FATE-test.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> Will apply this soon.
> 
>  libavfilter/dnn/dnn_backend_native_layer_conv2d.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> index 777a54db43..c52725aa2b 100644
> --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
> @@ -228,7 +228,7 @@ int dnn_execute_layer_conv2d(DnnOperand *operands,
> const int32_t *input_operand_
> 
>      //create threads
>      for (int i = 0; i < thread_num; i++){
> -        thread_param[i] = av_malloc(sizeof(thread_param));
> +        thread_param[i] = av_malloc(sizeof(**thread_param));
>          thread_param[i]->thread_common_param =
> &thread_common_param;
>          thread_param[i]->thread_index = i;
>          pthread_create(&thread_id[i], NULL,
> dnn_execute_layer_conv2d_thread, (void *)thread_param[i]);
> --
thanks Andreas.
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
index 777a54db43..c52725aa2b 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
@@ -228,7 +228,7 @@  int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_
 
     //create threads
     for (int i = 0; i < thread_num; i++){
-        thread_param[i] = av_malloc(sizeof(thread_param));
+        thread_param[i] = av_malloc(sizeof(**thread_param));
         thread_param[i]->thread_common_param = &thread_common_param;
         thread_param[i]->thread_index = i;
         pthread_create(&thread_id[i], NULL, dnn_execute_layer_conv2d_thread, (void *)thread_param[i]);