mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-04 16:50:19 +01:00
pdf: Assure compiler that data, data_size will always be initialized
There are only three possible color states: COLOR, GRAYSCALE, or MONOCHROME thus data and data_size will always be set to some value, so assert the default is never reached. Fixes these warning: cairo-pdf-surface.c:2517:32: warning: ‘data_size’ may be used uninitialized in this function [-Wuninitialized] cairo-pdf-surface.c:2338:19: note: ‘data_size’ was declared here cairo-pdf-surface.c:2446:11: warning: ‘data’ may be used uninitialized in this function [-Wuninitialized] cairo-pdf-surface.c:2337:11: note: ‘data’ was declared here Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This commit is contained in:
parent
27cb80b848
commit
aa764a3bbc
1 changed files with 3 additions and 1 deletions
|
|
@ -2389,8 +2389,10 @@ _cairo_pdf_surface_emit_image (cairo_pdf_surface_t *surface,
|
|||
|
||||
color = _cairo_image_analyze_color (image);
|
||||
switch (color) {
|
||||
case CAIRO_IMAGE_IS_COLOR:
|
||||
default:
|
||||
case CAIRO_IMAGE_UNKNOWN_COLOR:
|
||||
ASSERT_NOT_REACHED;
|
||||
case CAIRO_IMAGE_IS_COLOR:
|
||||
data_size = image->height * image->width * 3;
|
||||
data = _cairo_malloc_abc (image->width, image->height, 3);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue