mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-14 21:25:42 +08:00
[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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user