mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
matroska: don't alter passed data and especialy don't leak.
If we need different size, Make a copy, work with that and free it.
This commit is contained in:
parent
fa8e2d9bfe
commit
5ac6b84475
1 changed files with 5 additions and 3 deletions
|
@ -4981,9 +4981,8 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (size < sizeof (gst_riff_strf_vids)) {
|
if (size < sizeof (gst_riff_strf_vids)) {
|
||||||
vids =
|
vids = g_new (gst_riff_strf_vids, 1);
|
||||||
(gst_riff_strf_vids *) g_realloc (vids,
|
memcpy (vids, data, size);
|
||||||
sizeof (gst_riff_strf_vids));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* little-endian -> byte-order */
|
/* little-endian -> byte-order */
|
||||||
|
@ -5011,6 +5010,9 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
|
||||||
|
|
||||||
if (buf)
|
if (buf)
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
|
||||||
|
if (vids != (gst_riff_strf_vids *) data)
|
||||||
|
g_free (vids);
|
||||||
}
|
}
|
||||||
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_UNCOMPRESSED)) {
|
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_UNCOMPRESSED)) {
|
||||||
guint32 fourcc = 0;
|
guint32 fourcc = 0;
|
||||||
|
|
Loading…
Reference in a new issue