History

avfilter/vf_dnn_classify: add result check for av_frame_get_side_data

CID: 1482090 there can return null from av_frame_get_side_data, and will use sd->data after av_frame_get_side_data, so should check null return value.

Steven Liu committed 5 years ago

Commit 7ce0f241 parent c38bc561 file · +4 −0Browse files

Unified · Split

libavfilter/vf_dnn_classify.c+4−0
@@ -77,6 +77,10 @@ static int dnn_classify_post_proc(AVFrame *frame, DNNData *output, uint32_t bbox · 76 unmodified lines
7777 }
7878
7979 sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DETECTION_BBOXES);
80+ if (!sd) {
81+ av_log(filter_ctx, AV_LOG_ERROR, "Cannot get side data in dnn_classify_post_proc\n");
82+ return -1;
83+ }
8084 header = (AVDetectionBBoxHeader *)sd->data;
8185
8286 if (bbox_index == 0) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t