oggstream: Fix crashes with 0-byte vorbis packets

Fixes bug #655574.
This commit is contained in:
Jonathan Liu 2011-08-03 10:18:29 +02:00 committed by Sebastian Dröge
parent fe17585568
commit 8bd3bdaf37

View file

@ -792,7 +792,7 @@ packet_duration_vorbis (GstOggStream * pad, ogg_packet * packet)
int size;
int duration;
if (packet->packet[0] & 1)
if (packet->bytes == 0 || packet->packet[0] & 1)
return 0;
mode = (packet->packet[0] >> 1) & ((1 << pad->vorbis_log2_num_modes) - 1);