After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345232 - [wavparse] reads beyond end-of-file (in pull mode)
[wavparse] reads beyond end-of-file (in pull mode)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.3
Other Linux
: Normal normal
: 0.10.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-18 11:27 UTC by Mark Nauwelaerts
Modified: 2006-06-18 12:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debug output from a wavparse based pipeline (37.91 KB, text/plain)
2006-06-18 11:33 UTC, Mark Nauwelaerts
  Details
Possible patch (1.26 KB, patch)
2006-06-18 11:39 UTC, Mark Nauwelaerts
committed Details | Review

Description Mark Nauwelaerts 2006-06-18 11:27:25 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).
Comment 1 Mark Nauwelaerts 2006-06-18 11:33:27 UTC
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.
Comment 2 Mark Nauwelaerts 2006-06-18 11:39:25 UTC
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.
Comment 3 Tim-Philipp Müller 2006-06-18 12:41:07 UTC
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)