diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2024-05-08 00:08:18 +0800 |
---|---|---|
committer | Guo Yejun <yejun.guo@intel.com> | 2024-05-21 18:17:07 +0800 |
commit | 553c572204392f7a74bbfebcf3d33f1161976c8b (patch) | |
tree | 57f4e83edfc14ff975c2a5fc9770594056a8ba25 /libavfilter | |
parent | f7a1453f27583c36a3417c4a731b45ac4235b660 (diff) | |
download | ffmpeg-553c572204392f7a74bbfebcf3d33f1161976c8b.tar.gz |
avfilter/vf_dnn_detect: Fix null pointer dereference
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_dnn_detect.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c index 926966368a..1830bae181 100644 --- a/libavfilter/vf_dnn_detect.c +++ b/libavfilter/vf_dnn_detect.c @@ -807,11 +807,13 @@ static av_cold void dnn_detect_uninit(AVFilterContext *context) DnnDetectContext *ctx = context->priv; AVDetectionBBox *bbox; ff_dnn_uninit(&ctx->dnnctx); - while(av_fifo_can_read(ctx->bboxes_fifo)) { - av_fifo_read(ctx->bboxes_fifo, &bbox, 1); - av_freep(&bbox); + if (ctx->bboxes_fifo) { + while (av_fifo_can_read(ctx->bboxes_fifo)) { + av_fifo_read(ctx->bboxes_fifo, &bbox, 1); + av_freep(&bbox); + } + av_fifo_freep2(&ctx->bboxes_fifo); } - av_fifo_freep2(&ctx->bboxes_fifo); av_freep(&ctx->anchors); free_detect_labels(ctx); } |