From 00bbca2f9f1b4221bfea980740403c4f4a5d6b2a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 30 May 2013 05:24:32 +0200 Subject: [PATCH] videoconvert: free tmplines correctly Keep track of how many tmplines we allocated and use that to free the correct amount of lines. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701234 --- gst/videoconvert/videoconvert.c | 3 ++- gst/videoconvert/videoconvert.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gst/videoconvert/videoconvert.c b/gst/videoconvert/videoconvert.c index aac5abd922..55f9c2df87 100644 --- a/gst/videoconvert/videoconvert.c +++ b/gst/videoconvert/videoconvert.c @@ -90,7 +90,7 @@ videoconvert_convert_free (VideoConvert * convert) { gint i; - for (i = 0; i < convert->lines; i++) + for (i = 0; i < convert->n_tmplines; i++) g_free (convert->tmplines[i]); g_free (convert->tmplines); g_free (convert->errline); @@ -418,6 +418,7 @@ videoconvert_convert_compute_resample (VideoConvert * convert) lines = MAX (convert->down_n_lines, convert->up_n_lines); + convert->n_tmplines = lines; convert->tmplines = g_malloc (lines * sizeof (gpointer)); for (i = 0; i < lines; i++) convert->tmplines[i] = g_malloc (sizeof (guint16) * (width + 8) * 4); diff --git a/gst/videoconvert/videoconvert.h b/gst/videoconvert/videoconvert.h index 13c0c5778e..bc0aa7a00e 100644 --- a/gst/videoconvert/videoconvert.h +++ b/gst/videoconvert/videoconvert.h @@ -48,6 +48,7 @@ struct _VideoConvert { guint lines; + guint n_tmplines; gpointer *tmplines; guint16 *errline;