GNOME Bugzilla – Bug 345232
[wavparse] reads beyond end-of-file (in pull mode)
Last modified: 2006-06-18 12:41:07 UTC
wavparse can operate in push or pull mode. In push mode, pipeline with wavparse runs fine. In pull mode, pipeline terminates with error as wavparse tries to read more than there is in the .wav (see also attached debug output).
Created attachment 67565 [details] Debug output from a wavparse based pipeline Output from gst-launch-0.10 --gst-debug=wavparse:5 --gst-debug-no-color -v filesrc location=test.wav ! wavparse ! audioconvert ! audioresample ! osssink [test.wav is a 2 second test file produced by wavenc] At the end, wavparse still expects 2 bytes, due to end_offset (calculated in the intial perform_seek) being 2 larger than the file actually is.
Created attachment 67566 [details] [review] Possible patch _stream_headers takes the filesize into consideration, though the later (executed) _perform_seek does not (so directly). This patch makes the latter consider the filesize as well.
Thanks, modified to apply against CVS HEAD (there is no more _get_upstream_size() in HEAD) and committed: 2006-06-18 Tim-Philipp Müller <tim at centricular dot net> Patch by: Mark Nauwelaerts <manauw at skynet be> * gst/wavparse/gstwavparse.c: (gst_wavparse_perform_seek): Make sure we don't read beyond the end of the file (#345232). PS: the diff -p switch often makes patches easier to read (it adds the name of the C function for each chunk)