1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
This commit is contained in:
Steven Liu 2021-05-07 14:42:48 +08:00 committed by Guo, Yejun
parent c38bc5634d
commit 7ce0f246f4

View File

@ -77,6 +77,10 @@ static int dnn_classify_post_proc(AVFrame *frame, DNNData *output, uint32_t bbox
}
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DETECTION_BBOXES);
if (!sd) {
av_log(filter_ctx, AV_LOG_ERROR, "Cannot get side data in dnn_classify_post_proc\n");
return -1;
}
header = (AVDetectionBBoxHeader *)sd->data;
if (bbox_index == 0) {