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
This commit is contained in:
Wim Taymans 2013-05-30 05:24:32 +02:00
parent d32d2f0b14
commit 00bbca2f9f
2 changed files with 3 additions and 1 deletions

View file

@ -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);

View file

@ -48,6 +48,7 @@ struct _VideoConvert {
guint lines;
guint n_tmplines;
gpointer *tmplines;
guint16 *errline;