mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
rtpjpegdepay: Drop frame if it's less than 2 bytes large
https://bugzilla.gnome.org/show_bug.cgi?id=677560
This commit is contained in:
parent
504360fe36
commit
fdb667ae00
1 changed files with 11 additions and 0 deletions
|
@ -680,6 +680,9 @@ gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
|
|||
avail = gst_adapter_available (rtpjpegdepay->adapter);
|
||||
GST_DEBUG_OBJECT (rtpjpegdepay, "marker set, last buffer");
|
||||
|
||||
if (avail < 2)
|
||||
goto invalid_packet;
|
||||
|
||||
/* take the last bytes of the jpeg data to see if there is an EOI
|
||||
* marker */
|
||||
gst_adapter_copy (rtpjpegdepay->adapter, end, avail - 2, 2);
|
||||
|
@ -732,6 +735,14 @@ no_qtable:
|
|||
gst_rtp_buffer_unmap (&rtp);
|
||||
return NULL;
|
||||
}
|
||||
invalid_packet:
|
||||
{
|
||||
GST_WARNING_OBJECT (rtpjpegdepay, "invalid packet");
|
||||
gst_adapter_flush (rtpjpegdepay->adapter,
|
||||
gst_adapter_available (rtpjpegdepay->adapter));
|
||||
gst_rtp_buffer_unmap (&rtp);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue