summaryrefslogtreecommitdiff
path: root/extra/gstreamer0.10-base/oggstream-fix-crashes-with-0-byte-vorbis-packets.patch
blob: 8ba4c8ed32530dfe19ce9c5719f3d45b12a5488e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 8bd3bdaf3768b3fb6adc85b3bc681fdce07b786e Mon Sep 17 00:00:00 2001
From: Jonathan Liu <net147@gmail.com>
Date: Wed, 03 Aug 2011 08:18:29 +0000
Subject: oggstream: Fix crashes with 0-byte vorbis packets

Fixes bug #655574.
---
diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c
index e843f48..77f39d4 100644
--- a/ext/ogg/gstoggstream.c
+++ b/ext/ogg/gstoggstream.c
@@ -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);
--
cgit v0.8.3-6-g21f6