diff options
author | Wenbin Chen <wenbin.chen@intel.com> | 2023-07-17 13:33:01 +0800 |
---|---|---|
committer | Guo Yejun <yejun.guo@intel.com> | 2023-07-24 09:34:11 +0800 |
commit | 13f49a7c62094035ca169201b0313c853365651f (patch) | |
tree | 9dd39275e791a81d708b815b0e146405bf83905e /libavfilter | |
parent | 87f76d3bee083d33707ed2cb459507186e32fc12 (diff) | |
download | ffmpeg-13f49a7c62094035ca169201b0313c853365651f.tar.gz |
libavfilter/vf_dnn_detect: bbox index may bigger than bbox number
Fix a bug that queried bbox index may bigger than bbox's total number.
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_dnn_detect.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c index 06efce02a6..6ef04e0958 100644 --- a/libavfilter/vf_dnn_detect.c +++ b/libavfilter/vf_dnn_detect.c @@ -106,12 +106,11 @@ static int dnn_detect_post_proc_ov(AVFrame *frame, DNNData *output, AVFilterCont float x1 = detections[i * detect_size + 5]; float y1 = detections[i * detect_size + 6]; - bbox = av_get_detection_bbox(header, i); - if (conf < conf_threshold) { continue; } + bbox = av_get_detection_bbox(header, header->nb_bboxes - nb_bboxes); bbox->x = (int)(x0 * frame->width); bbox->w = (int)(x1 * frame->width) - bbox->x; bbox->y = (int)(y0 * frame->height); |