gst/matroska/ebml-read.c: Allow for 0-sized buffers. Fixes length query problems in starwars.mkv from the testsuite.

Original commit message from CVS:
* gst/matroska/ebml-read.c: (gst_ebml_read_buffer):
Allow for 0-sized buffers. Fixes length query problems in
starwars.mkv from the testsuite.
This commit is contained in:
Ronald S. Bultje 2005-01-19 19:31:54 +00:00
parent b43e960650
commit 2b6207564c
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/matroska/ebml-read.c: (gst_ebml_read_buffer):
Allow for 0-sized buffers. Fixes length query problems in
starwars.mkv from the testsuite.
2005-01-19 Tim-Philipp Müller <tim at centricular dot net>
* gst/videobox/gstvideobox.c: (gst_video_box_copy_plane_i420),

View file

@ -500,12 +500,18 @@ gst_ebml_read_buffer (GstEbmlRead * ebml, guint32 * id, GstBuffer ** buf)
if ((bytes = gst_ebml_read_element_id (ebml, id, NULL)) < 0)
return FALSE;
gst_bytestream_flush_fast (ebml->bs, bytes);
if ((bytes = gst_ebml_read_element_length (ebml, &length)) < 0)
return FALSE;
gst_bytestream_flush_fast (ebml->bs, bytes);
ebml->id_cache = 0;
if (length == 0) {
*buf = gst_buffer_new ();
return TRUE;
}
return ((*buf = gst_ebml_read_element_data (ebml, length)) != NULL);
}