Commit 50066062 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

gst/avi/gstavimux.c: Fix padding...

Original commit message from CVS:
* gst/avi/gstavimux.c: (gst_avimux_write_tag):
Fix padding...
parent 2b620756
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/avi/gstavimux.c: (gst_avimux_write_tag):
Fix padding...
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
 
* gst/matroska/ebml-read.c: (gst_ebml_read_buffer):
......
......@@ -591,7 +591,7 @@ gst_avimux_write_tag (const GstTagList * list, const gchar * tag, gpointer data)
GST_RIFF_INFO_IARL, GST_TAG_LOCATION}, {
0, NULL}
};
gint n, len;
gint n, len, plen;
GstBuffer *buf = data;
gchar *str;
......@@ -599,12 +599,15 @@ gst_avimux_write_tag (const GstTagList * list, const gchar * tag, gpointer data)
if (!strcmp (rifftags[n].tag, tag) &&
gst_tag_list_get_string (list, tag, &str)) {
len = strlen (str);
if (GST_BUFFER_MAXSIZE (buf) >= GST_BUFFER_SIZE (buf) + 8 + len + 1) {
plen = len + 1;
if (plen & 1)
plen++;
if (GST_BUFFER_MAXSIZE (buf) >= GST_BUFFER_SIZE (buf) + 8 + plen) {
GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf), rifftags[n].fcc);
GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf) + 4, len + 1);
memcpy (GST_BUFFER_DATA (buf) + 8, str, len);
GST_BUFFER_DATA (buf)[8 + len] = 0;
GST_BUFFER_SIZE (buf) += 8 + len + 1;
GST_BUFFER_SIZE (buf) += 8 + plen;
}
}
break;
......
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