flacparse: fix parsing with unknown framesizes
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Mon, 11 Oct 2010 15:06:48 +0000 (17:06 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 8 Apr 2011 17:07:10 +0000 (18:07 +0100)
Fixes #631814 (mostly).

gst/audioparsers/gstflacparse.c

index ec6a248..7b70fe1 100644 (file)
@@ -588,8 +588,12 @@ gst_flac_parse_frame_is_valid (GstFlacParse * flacparse, GstBuffer * buffer,
     goto need_more;
   }
 
+  /* mind unknown framesize */
   search_start = MAX (2, flacparse->min_framesize);
-  search_end = MIN (size, flacparse->max_framesize + 9 + 2);
+  if (flacparse->max_framesize)
+    search_end = MIN (size, flacparse->max_framesize + 9 + 2);
+  else
+    search_end = size;
   search_end -= 2;
 
   remaining = size;