Commit 687ec479 authored by Simon Budig's avatar Simon Budig

Fix the PSD structs to use signed ints for bounding box coordinates.

(cherry picked from commit 0e440cb6)
parent 153ae579
......@@ -533,10 +533,10 @@ read_layer_block (PSDimage *img_a,
psd_set_error (feof (f), errno, error);
return NULL;
}
lyr_a[lidx]->top = GUINT32_FROM_BE (lyr_a[lidx]->top);
lyr_a[lidx]->left = GUINT32_FROM_BE (lyr_a[lidx]->left);
lyr_a[lidx]->bottom = GUINT32_FROM_BE (lyr_a[lidx]->bottom);
lyr_a[lidx]->right = GUINT32_FROM_BE (lyr_a[lidx]->right);
lyr_a[lidx]->top = GINT32_FROM_BE (lyr_a[lidx]->top);
lyr_a[lidx]->left = GINT32_FROM_BE (lyr_a[lidx]->left);
lyr_a[lidx]->bottom = GINT32_FROM_BE (lyr_a[lidx]->bottom);
lyr_a[lidx]->right = GINT32_FROM_BE (lyr_a[lidx]->right);
lyr_a[lidx]->num_channels = GUINT16_FROM_BE (lyr_a[lidx]->num_channels);
if (lyr_a[lidx]->num_channels > MAX_CHANNELS)
......@@ -670,13 +670,13 @@ read_layer_block (PSDimage *img_a,
return NULL;
}
lyr_a[lidx]->layer_mask.top =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
lyr_a[lidx]->layer_mask.left =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
lyr_a[lidx]->layer_mask.bottom =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
lyr_a[lidx]->layer_mask.right =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
lyr_a[lidx]->layer_mask.mask_flags.relative_pos =
lyr_a[lidx]->layer_mask.flags & 1 ? TRUE : FALSE;
lyr_a[lidx]->layer_mask.mask_flags.disabled =
......@@ -702,21 +702,21 @@ read_layer_block (PSDimage *img_a,
return NULL;
}
lyr_a[lidx]->layer_mask_extra.top =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.top);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.top);
lyr_a[lidx]->layer_mask_extra.left =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.left);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.left);
lyr_a[lidx]->layer_mask_extra.bottom =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.bottom);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.bottom);
lyr_a[lidx]->layer_mask_extra.right =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.right);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.right);
lyr_a[lidx]->layer_mask.top =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
lyr_a[lidx]->layer_mask.left =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
lyr_a[lidx]->layer_mask.bottom =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
lyr_a[lidx]->layer_mask.right =
GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
GINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
lyr_a[lidx]->layer_mask.mask_flags.relative_pos =
lyr_a[lidx]->layer_mask.flags & 1 ? TRUE : FALSE;
lyr_a[lidx]->layer_mask.mask_flags.disabled =
......
......@@ -447,10 +447,10 @@ typedef struct
/* PSD Layer mask data (length 20) */
typedef struct
{
guint32 top; /* Layer top */
guint32 left; /* Layer left */
guint32 bottom; /* Layer bottom */
guint32 right; /* Layer right */
gint32 top; /* Layer top */
gint32 left; /* Layer left */
gint32 bottom; /* Layer bottom */
gint32 right; /* Layer right */
guchar def_color; /* Default background colour */
guchar flags; /* Layer flags */
guchar extra_def_color; /* Real default background colour */
......@@ -461,20 +461,20 @@ typedef struct
/* PSD Layer mask data (length 36) */
typedef struct
{
guint32 top; /* Layer top */
guint32 left; /* Layer left */
guint32 bottom; /* Layer bottom */
guint32 right; /* Layer right */
gint32 top; /* Layer top */
gint32 left; /* Layer left */
gint32 bottom; /* Layer bottom */
gint32 right; /* Layer right */
} LayerMaskExtra;
/* PSD Layer data structure */
typedef struct
{
gboolean drop; /* Do not add layer to GIMP image */
guint32 top; /* Layer top */
guint32 left; /* Layer left */
guint32 bottom; /* Layer bottom */
guint32 right; /* Layer right */
gint32 top; /* Layer top */
gint32 left; /* Layer left */
gint32 bottom; /* Layer bottom */
gint32 right; /* Layer right */
guint16 num_channels; /* Number of channels */
ChannelLengthInfo *chn_info; /* Channel length info */
gchar mode_key[4]; /* Blend mode key */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment