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.
This commit is contained in:
Tim-Philipp Müller 2006-05-19 13:37:55 +00:00
parent f3b81a7de1
commit 3ef484fe2b
2 changed files with 19 additions and 8 deletions

View file

@ -1,3 +1,10 @@
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):

View file

@ -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;