Commit a90f59d9 authored by Ell's avatar Ell

app: fix alignment of generic pixel buffers

Wherever we store arbitrary-format colors in an opaque buffer, use
double for the buffer, instead of char, so that it has a strict-
enough alignment to handle all our used pixel formats.
parent 7412c4be
Pipeline #180602 passed with stages
in 26 minutes and 3 seconds
......@@ -240,7 +240,7 @@ gimp_pickable_get_color_at (GimpPickable *pickable,
gint y,
GimpRGB *color)
{
guchar pixel[32];
gdouble pixel[4];
g_return_val_if_fail (GIMP_IS_PICKABLE (pickable), FALSE);
g_return_val_if_fail (color != NULL, FALSE);
......
......@@ -724,7 +724,7 @@ gimp_cursor_view_cursor_idle (GimpCursorView *view)
gboolean in_image;
gchar buf[32];
const Babl *sample_format;
guchar pixel[32];
gdouble pixel[4];
GimpRGB color;
gdouble xres;
gdouble yres;
......
......@@ -627,7 +627,7 @@ gimp_color_tool_pick (GimpColorTool *tool,
{
GimpColorToolClass *klass;
const Babl *sample_format;
guchar pixel[32];
gdouble pixel[4];
GimpRGB color;
klass = GIMP_COLOR_TOOL_GET_CLASS (tool);
......
......@@ -796,7 +796,10 @@ gimp_color_frame_update (GimpColorFrame *frame)
g_free (tmp);
if (! frame->sample_average)
values[4] = g_strdup_printf ("%d", frame->pixel[0]);
{
values[4] = g_strdup_printf (
"%d", ((guint8 *) frame->pixel)[0]);
}
}
}
}
......
......@@ -39,7 +39,7 @@ struct _GimpColorFrame
gboolean sample_valid;
gboolean sample_average;
const Babl *sample_format;
guchar pixel[32];
gdouble pixel[4];
GimpRGB color;
gint x;
gint y;
......
......@@ -551,7 +551,7 @@ gimp_sample_point_editor_update (GimpSamplePointEditor *editor)
{
GimpSamplePoint *sample_point = list->data;
const Babl *format;
guchar pixel[32];
gdouble pixel[4];
GimpRGB color;
GimpColorPickMode pick_mode;
gint x;
......
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