summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorSteven Liu <liuqi05@kuaishou.com>2021-05-07 14:42:48 +0800
committerGuo, Yejun <yejun.guo@intel.com>2021-05-11 10:49:33 +0800
commit7ce0f246f48459a65aedeabce58afdaa988d0eaf (patch)
treeddf9b1fec3591d04cfe7eb9cf1e5845f1eff5745 /libavfilter
parentc38bc5634d8eb4540cb8dfa616eafcc0b3c85e59 (diff)
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>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_dnn_classify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/vf_dnn_classify.c b/libavfilter/vf_dnn_classify.c
index 18fcd452d0..7900255cfe 100644
--- a/libavfilter/vf_dnn_classify.c
+++ b/libavfilter/vf_dnn_classify.c
@@ -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) {