mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
mpegtsdemux: fix possible read beyond end of buffer when resyncing
This commit is contained in:
parent
4b10f278b6
commit
cf791f6cb0
1 changed files with 1 additions and 1 deletions
|
@ -800,7 +800,7 @@ mpegts_packetizer_next_packet (MpegTSPacketizer2 * packetizer,
|
|||
GST_LOG ("Lost sync %d", packet_size);
|
||||
|
||||
/* Find the 0x47 in the buffer (and require at least 2 checks) */
|
||||
for (; sync_offset < priv->mapped_size + 2 * packet_size; sync_offset++)
|
||||
for (; sync_offset + 2 * packet_size < priv->mapped_size; sync_offset++)
|
||||
if (priv->mapped[sync_offset] == 0x47 &&
|
||||
priv->mapped[sync_offset + packet_size] == 0x47 &&
|
||||
priv->mapped[sync_offset + 2 * packet_size] == 0x47)
|
||||
|
|
Loading…
Reference in a new issue