[mpp]: avoid crash when dumping a frame whose fd is -1

Change-Id: I6c7252ac32a4b857a79a4203fdaa56a2f0443645
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding
2019-01-04 17:32:44 +08:00
parent ce946385b0
commit c8875a2db9

View File

@@ -324,6 +324,11 @@ MPP_RET mpp_ops_dec_get_frm(MppDump info, MppFrame frame)
info_change, error, discard, mpp_frame_get_pts(frame));
}
if (NULL == buf || fd < 0) {
mpp_err("failed to dump frame\n");
return MPP_NOK;
}
dump_frame(p->fp_out, frame, p->fp_buf, p->dump_width, p->dump_height);
if (p->debug & MPP_DBG_DUMP_LOG) {