Index: gst/wavparse/gstwavparse.c
===================================================================
--- gst/wavparse/gstwavparse.c	(revision 151)
+++ gst/wavparse/gstwavparse.c	(working copy)
@@ -79,6 +79,9 @@
 static GstStateChangeReturn gst_wavparse_change_state (GstElement * element,
     GstStateChange transition);
 
+static gboolean gst_wavparse_get_upstream_size (GstWavParse * wav,
+    gint64 * len);
+
 static gboolean gst_wavparse_pad_query (GstPad * pad, GstQuery * query);
 static const GstQueryType *gst_wavparse_get_query_types (GstPad * pad);
 static gboolean gst_wavparse_pad_convert (GstPad * pad,
@@ -773,7 +776,7 @@
   GstFormat format;
   GstSeekFlags flags;
   GstSeekType cur_type, stop_type;
-  gint64 cur, stop;
+  gint64 cur, stop, upstream_size;
   gboolean flush;
   gboolean update;
   GstSegment seeksegment;
@@ -844,6 +847,13 @@
   } else {
     wav->end_offset = wav->datasize + wav->datastart;
   }
+
+  /* make sure filesize is not exceeded due to rounding errors or so,
+   * same precaution as in _stream_headers */
+  if (gst_wavparse_get_upstream_size (wav, &upstream_size)) {
+    wav->end_offset = MIN (wav->end_offset, upstream_size);
+  }
+
   wav->offset = MIN (wav->offset, wav->end_offset);
   wav->dataleft = wav->end_offset - wav->offset;
 
