gst/matroska/matroska-demux.c: Lace sizes can be zero.

Original commit message from CVS:
* gst/matroska/matroska-demux.c: (gst_matroska_ebmlnum_uint),
(gst_matroska_ebmlnum_sint), (gst_matroska_demux_parse_blockgroup):
Lace sizes can be zero.
This commit is contained in:
Ronald S. Bultje 2004-12-18 22:40:24 +00:00
parent 5297ba1a22
commit 59726ae2df
2 changed files with 18 additions and 9 deletions

View file

@ -1,3 +1,9 @@
2004-12-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/matroska/matroska-demux.c: (gst_matroska_ebmlnum_uint),
(gst_matroska_ebmlnum_sint), (gst_matroska_demux_parse_blockgroup):
Lace sizes can be zero.
2004-12-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net> 2004-12-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/musepack/gstmusepackdec.cpp: * ext/musepack/gstmusepackdec.cpp:

View file

@ -1713,10 +1713,7 @@ gst_matroska_ebmlnum_uint (guint8 * data, guint size, guint64 * num)
n++; n++;
} }
if (!total) if (read == num_ffs && total != 0)
return -1;
if (read == num_ffs)
*num = G_MAXUINT64; *num = G_MAXUINT64;
else else
*num = total; *num = total;
@ -1735,10 +1732,12 @@ gst_matroska_ebmlnum_sint (guint8 * data, guint size, gint64 * num)
return -1; return -1;
/* make signed */ /* make signed */
if (unum == G_MAXUINT64) if (unum == G_MAXUINT64 && res > 1)
*num = G_MAXINT64; *num = G_MAXINT64;
else else if (unum != 0)
*num = unum - ((1 << ((7 * res) - 1)) - 1); *num = unum - ((1 << ((7 * res) - 1)) - 1);
else
*num = 0;
return res; return res;
} }
@ -1968,9 +1967,13 @@ gst_matroska_demux_parse_blockgroup (GstMatroskaDemux * demux,
duration = demux->src[stream]->default_duration; duration = demux->src[stream]->default_duration;
} }
for (n = 0; n < laces; n++) { for (n = 0; n < laces; n++) {
GstBuffer *sub = gst_buffer_create_sub (buf, GstBuffer *sub;
GST_BUFFER_SIZE (buf) - size,
lace_size[n]); if (lace_size[n] == 0)
continue;
sub = gst_buffer_create_sub (buf,
GST_BUFFER_SIZE (buf) - size, lace_size[n]);
if (cluster_time != GST_CLOCK_TIME_NONE) { if (cluster_time != GST_CLOCK_TIME_NONE) {
if (time < 0 && (-time) > cluster_time) if (time < 0 && (-time) > cluster_time)