oggstream: Fix crashes with 0-byte vorbis packets
authorJonathan Liu <net147@gmail.com>
Wed, 3 Aug 2011 08:18:29 +0000 (10:18 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 3 Aug 2011 08:18:29 +0000 (10:18 +0200)
Fixes bug #655574.

ext/ogg/gstoggstream.c

index e843f48..77f39d4 100644 (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);