gems/png_image.h: fix context pointer handling

This patch fixes a problem that unsurfaced by the commit "menu_view: API
transition", which changed the class layout of the 'Png_image' so that
the 'Read_struct' pointer is no longer equal to the 'Png_image' pointer.
This commit is contained in:
Norman Feske 2017-01-18 18:43:52 +01:00 committed by Christian Helmuth
parent e43da51bd6
commit ddcc1cf6aa

View File

@ -59,9 +59,9 @@ class Png_image
static void callback(png_structp png_ptr, png_bytep dst, png_size_t len)
{
Png_image *png = (Png_image *)png_get_io_ptr(png_ptr);
Genode::memcpy(dst, png->_read_struct.data + png->_read_struct.pos, len);
png->_read_struct.pos += len;
Read_struct &read_struct = *(Read_struct *)png_get_io_ptr(png_ptr);
Genode::memcpy(dst, read_struct.data + read_struct.pos, len);
read_struct.pos += len;
}
png_structp png_ptr =