diff options
Diffstat (limited to 'gst/matroska/matroska-demux.c')
-rw-r--r-- | gst/matroska/matroska-demux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 118a3d6fb..6b9c377bf 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -4978,15 +4978,14 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext * /* assure size is big enough */ if (size < 24) { GST_WARNING ("Too small BITMAPINFOHEADER (%d bytes)", size); return NULL; } if (size < sizeof (gst_riff_strf_vids)) { - vids = - (gst_riff_strf_vids *) g_realloc (vids, - sizeof (gst_riff_strf_vids)); + vids = g_new (gst_riff_strf_vids, 1); + memcpy (vids, data, size); } /* little-endian -> byte-order */ vids->size = GUINT32_FROM_LE (vids->size); vids->width = GUINT32_FROM_LE (vids->width); vids->height = GUINT32_FROM_LE (vids->height); @@ -5008,12 +5007,15 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext * caps = gst_riff_create_video_caps (vids->compression, NULL, vids, buf, NULL, codec_name); if (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)) { guint32 fourcc = 0; switch (videocontext->fourcc) { case GST_MAKE_FOURCC ('I', '4', '2', '0'): |