oggstream: fix crash with 0 byte ogg packets

https://bugzilla.gnome.org/show_bug.cgi?id=687030
This commit is contained in:
Jonathan Liu 2012-10-28 21:07:16 +11:00 committed by Tim-Philipp Müller
parent f816f94995
commit 7f22e3ea7f

View file

@ -790,7 +790,7 @@ setup_vorbis_mapper (GstOggStream * pad, ogg_packet * packet)
static gboolean static gboolean
is_header_vorbis (GstOggStream * pad, ogg_packet * packet) is_header_vorbis (GstOggStream * pad, ogg_packet * packet)
{ {
if (packet->bytes > 0 && (packet->packet[0] & 0x01) == 0) if (packet->bytes == 0 || (packet->packet[0] & 0x01) == 0)
return FALSE; return FALSE;
if (packet->packet[0] == 5) { if (packet->packet[0] == 5) {