forked from AuroraMiddleware/gtk
free the result of gdk_pixdata_serialize() (bug #89411).
2002-07-31 Sven Neumann <sven@gimp.org> * gdk-pixdata.c (gdk_pixdata_to_csource): free the result of gdk_pixdata_serialize() (bug #89411).
This commit is contained in:
parent
cc375a49d7
commit
0a786328d2
@ -1,3 +1,8 @@
|
|||||||
|
2002-07-31 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* gdk-pixdata.c (gdk_pixdata_to_csource): free the result of
|
||||||
|
gdk_pixdata_serialize() (bug #89411).
|
||||||
|
|
||||||
Mon Jul 29 23:06:10 2002 Owen Taylor <otaylor@redhat.com>
|
Mon Jul 29 23:06:10 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gdk-pixbuf-scale.c: Fix some warnings by adding
|
* gdk-pixbuf-scale.c: Fix some warnings by adding
|
||||||
|
@ -594,7 +594,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
|||||||
guint bpp, width, height, rowstride;
|
guint bpp, width, height, rowstride;
|
||||||
gboolean rle_encoded;
|
gboolean rle_encoded;
|
||||||
gchar *macro_name;
|
gchar *macro_name;
|
||||||
guint8 *img_buffer, *img_buffer_end, *stream;
|
guint8 *img_buffer, *img_buffer_end, *stream = NULL;
|
||||||
guint stream_length;
|
guint stream_length;
|
||||||
GString *gstring;
|
GString *gstring;
|
||||||
|
|
||||||
@ -725,6 +725,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
|||||||
guint pix_length = img_buffer_end - img_buffer;
|
guint pix_length = img_buffer_end - img_buffer;
|
||||||
|
|
||||||
stream = gdk_pixdata_serialize (pixdata, &stream_length);
|
stream = gdk_pixdata_serialize (pixdata, &stream_length);
|
||||||
|
img_buffer = stream;
|
||||||
img_buffer_end = stream + stream_length;
|
img_buffer_end = stream + stream_length;
|
||||||
|
|
||||||
APPEND (gstring, "%s%s%s %s[] = \n",
|
APPEND (gstring, "%s%s%s %s[] = \n",
|
||||||
@ -734,34 +735,33 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
|||||||
APPEND (gstring, "{ \"\"\n /* Pixbuf magic (0x%x) */\n \"",
|
APPEND (gstring, "{ \"\"\n /* Pixbuf magic (0x%x) */\n \"",
|
||||||
GDK_PIXBUF_MAGIC_NUMBER);
|
GDK_PIXBUF_MAGIC_NUMBER);
|
||||||
cdata.pos = 3;
|
cdata.pos = 3;
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
APPEND (gstring, "\"\n /* length: header (%u) + pixel_data (%u) */\n \"",
|
APPEND (gstring, "\"\n /* length: header (%u) + pixel_data (%u) */\n \"",
|
||||||
GDK_PIXDATA_HEADER_LENGTH,
|
GDK_PIXDATA_HEADER_LENGTH,
|
||||||
rle_encoded ? pix_length : rowstride * height);
|
rle_encoded ? pix_length : rowstride * height);
|
||||||
cdata.pos = 3;
|
cdata.pos = 3;
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
APPEND (gstring, "\"\n /* pixdata_type (0x%x) */\n \"",
|
APPEND (gstring, "\"\n /* pixdata_type (0x%x) */\n \"",
|
||||||
pixdata->pixdata_type);
|
pixdata->pixdata_type);
|
||||||
cdata.pos = 3;
|
cdata.pos = 3;
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
APPEND (gstring, "\"\n /* rowstride (%u) */\n \"",
|
APPEND (gstring, "\"\n /* rowstride (%u) */\n \"",
|
||||||
rowstride);
|
rowstride);
|
||||||
cdata.pos = 3;
|
cdata.pos = 3;
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
APPEND (gstring, "\"\n /* width (%u) */\n \"", width);
|
APPEND (gstring, "\"\n /* width (%u) */\n \"", width);
|
||||||
cdata.pos = 3;
|
cdata.pos = 3;
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
APPEND (gstring, "\"\n /* height (%u) */\n \"", height);
|
APPEND (gstring, "\"\n /* height (%u) */\n \"", height);
|
||||||
cdata.pos = 3;
|
cdata.pos = 3;
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
save_uchar (&cdata, *stream++); save_uchar (&cdata, *stream++);
|
save_uchar (&cdata, *img_buffer++); save_uchar (&cdata, *img_buffer++);
|
||||||
APPEND (gstring, "\"\n /* pixel_data: */\n");
|
APPEND (gstring, "\"\n /* pixel_data: */\n");
|
||||||
img_buffer = stream;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pixel_data intro
|
/* pixel_data intro
|
||||||
@ -812,6 +812,7 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata,
|
|||||||
|
|
||||||
/* cleanup
|
/* cleanup
|
||||||
*/
|
*/
|
||||||
|
g_free (stream);
|
||||||
g_free (macro_name);
|
g_free (macro_name);
|
||||||
|
|
||||||
return gstring;
|
return gstring;
|
||||||
|
Loading…
Reference in New Issue
Block a user