diff mbox series

[FFmpeg-devel,4/4] libavfilter/vf_dnn_detect: Set used pointer to NULL

Message ID 20231214024928.230112-4-wenbin.chen@intel.com
State Accepted
Commit 22bebfa5e6cfcbd332a387b6f91ae38a4cbaf8b9
Headers show
Series [FFmpeg-devel,1/4] libavfilter/vf_dnn_detect: Fix an incorrect expression | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Chen, Wenbin Dec. 14, 2023, 2:49 a.m. UTC
From: Wenbin Chen <wenbin.chen@intel.com>

Set used pointer to NULL in case it leaks the storage.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
---
 libavfilter/vf_dnn_detect.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Guo, Yejun Dec. 15, 2023, 9:36 a.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> wenbin.chen-at-intel.com@ffmpeg.org
> Sent: Thursday, December 14, 2023 10:49 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH 4/4] libavfilter/vf_dnn_detect: Set used
> pointer to NULL
> 
> From: Wenbin Chen <wenbin.chen@intel.com>
> 
> Set used pointer to NULL in case it leaks the storage.
> 
> Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
> ---
>  libavfilter/vf_dnn_detect.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c index
> 5668b8b017..3464af86c8 100644
> --- a/libavfilter/vf_dnn_detect.c
> +++ b/libavfilter/vf_dnn_detect.c
> @@ -223,6 +223,7 @@ static int dnn_detect_parse_yolo_output(AVFrame
> *frame, DNNData *output, int out
>                      av_freep(&bbox);
>                      return AVERROR(ENOMEM);
>                  }
> +                bbox = NULL;
>              }
>      }
>      return 0;
> --
LGTM, will push soon.
diff mbox series

Patch

diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c
index 5668b8b017..3464af86c8 100644
--- a/libavfilter/vf_dnn_detect.c
+++ b/libavfilter/vf_dnn_detect.c
@@ -223,6 +223,7 @@  static int dnn_detect_parse_yolo_output(AVFrame *frame, DNNData *output, int out
                     av_freep(&bbox);
                     return AVERROR(ENOMEM);
                 }
+                bbox = NULL;
             }
     }
     return 0;