Commit 3ef484fe authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/riff/riff-read.c: Don't bail out on JUNK chunks with a size of 0...

gst-libs/gst/riff/riff-read.c: Don't bail out on JUNK chunks with a size of 0 (would try to pull_range 0 bytes before...

Original commit message from CVS:
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_chunk):
Don't bail out on JUNK chunks with a size of 0 (would try to
pull_range 0 bytes before, which sources don't like too much).
See #342345.
parent f3b81a7d
2006-05-19 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_chunk):
Don't bail out on JUNK chunks with a size of 0 (would try to
pull_range 0 bytes before, which sources don't like too much).
See #342345.
2006-05-19 Jan Schmidt <thaytan@mad.scientist.com>
 
* gst/videoscale/gstvideoscale.c: (gst_video_scale_fixate_caps):
......
......@@ -69,14 +69,18 @@ gst_riff_read_chunk (GstElement * element,
memcpy (dbg, tag, 4);
GST_DEBUG_OBJECT (element, "tag=%s, size=%u", dbg, size);
if ((res = gst_pad_pull_range (pad, offset + 8, size, &buf)) != GST_FLOW_OK)
return res;
else if (!buf || GST_BUFFER_SIZE (buf) < size) {
GST_DEBUG_OBJECT (element, "not enough data (available=%u, needed=%u)",
(buf) ? GST_BUFFER_SIZE (buf) : 0, size);
if (buf)
gst_buffer_unref (buf);
return GST_FLOW_ERROR;
if (*tag == GST_RIFF_TAG_JUNK && size == 0) {
buf = gst_buffer_new ();
} else {
if ((res = gst_pad_pull_range (pad, offset + 8, size, &buf)) != GST_FLOW_OK)
return res;
if (!buf || GST_BUFFER_SIZE (buf) < size) {
GST_DEBUG_OBJECT (element, "not enough data (available=%u, needed=%u)",
(buf) ? GST_BUFFER_SIZE (buf) : 0, size);
if (buf)
gst_buffer_unref (buf);
return GST_FLOW_ERROR;
}
}
*_chunk_data = buf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment