vorbisparse: fix header detection
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 1 Feb 2012 16:32:24 +0000 (16:32 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 1 Feb 2012 16:40:35 +0000 (16:40 +0000)
It was matching non header packets.

This fixes various leaks, where buffers would be pushed onto a headers
list, but never popped.

Might also fix corruption as those buffers were dropped from the output
silently...

https://bugzilla.gnome.org/show_bug.cgi?id=669167

ext/vorbis/gstvorbisparse.c

index 4e905d8..19b2b5f 100644 (file)
@@ -401,8 +401,13 @@ vorbis_parse_parse_packet (GstVorbisParse * parse, GstBuffer * buf)
 
   have_header = FALSE;
   if (size >= 1) {
-    if (data[0] >= 0x01 && data[0] <= 0x05)
-      have_header = TRUE;
+    switch (data[0]) {
+      case 1:
+      case 3:
+      case 5:
+        have_header = TRUE;
+        break;
+    }
   }
 
   if (have_header) {