mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-04 14:22:12 +00:00
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>
This commit is contained in:
parent
87f76d3bee
commit
13f49a7c62
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user