mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
oggdemux: Handle invalid-sized packets
On invalid packets there is the possibility we might end up wanting to trim/offset more than what is available. oss-fuzz issue #5866
This commit is contained in:
parent
dbae19773a
commit
0d14819ef2
1 changed files with 9 additions and 1 deletions
|
@ -778,7 +778,9 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
|
|||
pad->prev_granule = pad->current_granule;
|
||||
}
|
||||
|
||||
if (pad->map.is_ogm_text) {
|
||||
if (G_UNLIKELY (offset + trim > packet->bytes))
|
||||
goto invalid_packet;
|
||||
else if (pad->map.is_ogm_text) {
|
||||
/* check for invalid buffer sizes */
|
||||
if (G_UNLIKELY (offset + trim >= packet->bytes))
|
||||
goto empty_packet;
|
||||
|
@ -901,6 +903,12 @@ empty_packet:
|
|||
goto done;
|
||||
}
|
||||
|
||||
invalid_packet:
|
||||
{
|
||||
GST_DEBUG_OBJECT (ogg, "Skipping invalid packet");
|
||||
goto done;
|
||||
}
|
||||
|
||||
no_timestamp:
|
||||
{
|
||||
GST_DEBUG_OBJECT (ogg, "skipping packet: no valid granule found yet");
|
||||
|
|
Loading…
Reference in a new issue