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.
(cherry picked from commit a90f59d961
)
This commit is contained in:
@ -236,7 +236,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);
|
||||
|
@ -727,7 +727,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;
|
||||
|
@ -629,7 +629,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);
|
||||
|
@ -798,7 +798,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;
|
||||
|
@ -548,7 +548,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;
|
||||
|
Reference in New Issue
Block a user