123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- --- DirectFB-1.4.11.orig/tools/directfb-csource.c 2010-10-31 09:49:49.000000000 +0100
- +++ DirectFB-1.4.11/tools/directfb-csource.c 2011-03-29 10:57:18.453068981 +0200
- @@ -338,7 +338,7 @@ static DFBResult load_image (const char
- if (!png_ptr)
- goto cleanup;
-
- - if (setjmp (png_ptr->jmpbuf)) {
- + if (setjmp (png_jmpbuf (png_ptr))) {
- if (desc->preallocated[0].data) {
- free (desc->preallocated[0].data);
- desc->preallocated[0].data = NULL;
- @@ -405,17 +405,22 @@ static DFBResult load_image (const char
- }
-
- switch (src_format) {
- - case DSPF_LUT8:
- - if (info_ptr->num_palette) {
- + case DSPF_LUT8: {
- + png_colorp png_palette;
- + int num_palette;
- +
- + png_get_PLTE( png_ptr, info_ptr, &png_palette, &num_palette );
- +
- + if (num_palette) {
- png_byte *alpha;
- int i, num;
-
- - *palette_size = MIN (info_ptr->num_palette, 256);
- + *palette_size = MIN (num_palette, 256);
- for (i = 0; i < *palette_size; i++) {
- palette[i].a = 0xFF;
- - palette[i].r = info_ptr->palette[i].red;
- - palette[i].g = info_ptr->palette[i].green;
- - palette[i].b = info_ptr->palette[i].blue;
- + palette[i].r = png_palette[i].red;
- + palette[i].g = png_palette[i].green;
- + palette[i].b = png_palette[i].blue;
- }
- if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) {
- png_get_tRNS (png_ptr, info_ptr, &alpha, &num, NULL);
- @@ -424,6 +429,7 @@ static DFBResult load_image (const char
- }
- }
- break;
- + }
- case DSPF_RGB32:
- png_set_filler (png_ptr, 0xFF,
- #ifdef WORDS_BIGENDIAN
|