From: Haihao Xiang Date: Wed, 22 May 2019 04:25:38 +0000 (+0800) Subject: ivfparse: Check the data size against IVF_FRAME_HEADER_SIZE X-Git-Tag: 1.16.2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a93a198c5bc6799c366866e2bcfc9690dd023c81;p=platform%2Fupstream%2Fgst-plugins-bad.git ivfparse: Check the data size against IVF_FRAME_HEADER_SIZE It is parsing frame data and so should check the data size against the frame header size instead of the file header size. If don't, it is possible to drop the last frame because IVF_FILE_HEADER_SIZE is greater than IVF_FRAME_HEADER_SIZE --- diff --git a/gst/ivfparse/gstivfparse.c b/gst/ivfparse/gstivfparse.c index c50c361..14dd0dd 100644 --- a/gst/ivfparse/gstivfparse.c +++ b/gst/ivfparse/gstivfparse.c @@ -299,7 +299,7 @@ gst_ivf_parse_handle_frame_data (GstIvfParse * ivf, GstBaseParseFrame * frame, GstBuffer *out_buffer; gst_buffer_map (buffer, &map, GST_MAP_READ); - if (map.size >= IVF_FILE_HEADER_SIZE) { + if (map.size >= IVF_FRAME_HEADER_SIZE) { guint32 frame_size = GST_READ_UINT32_LE (map.data); guint64 frame_pts = GST_READ_UINT64_LE (map.data + 4);