* clutter/cogl/common/cogl-bitmap-pixbuf.c:
(_cogl_bitmap_from_file): allocate height×rowstride and not duplicate gdkpixbuf's strange optimization saving some bytes at the end of the pixbuf.
This commit is contained in:
parent
93abcf9595
commit
1ee75faaa4
@ -134,7 +134,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
/* FIXME: Any way to destroy pixbuf but retain pixel data? */
|
||||
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
out_data = (guchar*) g_malloc ((height - 1) * rowstride + last_row_size);
|
||||
out_data = (guchar*) g_malloc (height * rowstride);
|
||||
out = out_data;
|
||||
|
||||
/* Copy up to last row */
|
||||
@ -152,7 +152,10 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
/* Store bitmap info */
|
||||
bmp->data = out_data;
|
||||
bmp->data = out_data; /* The stored data the same alignment constraints as a
|
||||
* gdkpixbuf but stores a full rowstride in the last
|
||||
* scanline
|
||||
*/
|
||||
bmp->format = pixel_format;
|
||||
bmp->width = width;
|
||||
bmp->height = height;
|
||||
|
Loading…
Reference in New Issue
Block a user