From 809546c324b86fbfe37de8ce5543d03d2206a2f2 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 1 Feb 2012 16:32:24 +0000 Subject: [PATCH] vorbisparse: fix header detection 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/vorbis/gstvorbisparse.c b/ext/vorbis/gstvorbisparse.c index 4e905d8512..19b2b5fc2e 100644 --- a/ext/vorbis/gstvorbisparse.c +++ b/ext/vorbis/gstvorbisparse.c @@ -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) {