Skip to content

Commit 607da57

Browse files
committed
cairo_io/cairo-image-surface-xcf.c: Initialize some variables.
These were being warned about in the build. The functions involved could potentially finish early without the variables ever being used, and their cleanups were dependent on their being NULL or not. Fixes #89
1 parent 60e4d16 commit 607da57

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

extensions/cairo_io/cairo-image-surface-xcf.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,8 @@ _cairo_image_surface_paint_layer (cairo_surface_t *image,
581581

582582
mask_row = layer->alpha_mask + (y * layer_width) + x;
583583

584+
rand_gen = NULL;
585+
584586
if (layer->mode == GIMP_LAYER_MODE_DISSOLVE)
585587
rand_gen = g_rand_new_with_seed (DISSOLVE_SEED);
586588

@@ -1190,6 +1192,11 @@ _cairo_image_surface_create_from_xcf (GInputStream *istream,
11901192

11911193
performance (DEBUG_INFO, "end init");
11921194

1195+
compression = GIMP_COMPRESSION_RLE;
1196+
layers = NULL;
1197+
layer_offsets = NULL;
1198+
colormap = NULL;
1199+
11931200
data_stream = g_data_input_stream_new (istream);
11941201
g_data_input_stream_set_byte_order (data_stream, G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN);
11951202

@@ -1230,10 +1237,6 @@ _cairo_image_surface_create_from_xcf (GInputStream *istream,
12301237

12311238
/* properties */
12321239

1233-
compression = GIMP_COMPRESSION_RLE;
1234-
layers = NULL;
1235-
colormap = NULL;
1236-
12371240
read_properties = TRUE;
12381241
n_properties = 0;
12391242
while (read_properties) {

0 commit comments

Comments
 (0)