Skip to content

Commit

Permalink
ReadWebP: fix for big-endian
Browse files Browse the repository at this point in the history
Change-Id: I36b3c12ccf02eb5dad350c460387c0528fff8df3
  • Loading branch information
skal65535 authored and jzern committed Feb 15, 2018
1 parent 499c395 commit 3005237
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions imageio/webpdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
//
// WebP decode.

#ifdef HAVE_CONFIG_H
#include "webp/config.h"
#endif

#include "./webpdec.h"

#include <stdio.h>
Expand Down Expand Up @@ -150,7 +154,11 @@ int ReadWebP(const uint8_t* const data, size_t data_size,
break;
}
if (pic->use_argb) {
#ifdef WORDS_BIGENDIAN
output_buffer->colorspace = MODE_ARGB;
#else
output_buffer->colorspace = MODE_BGRA;
#endif
output_buffer->u.RGBA.rgba = (uint8_t*)pic->argb;
output_buffer->u.RGBA.stride = pic->argb_stride * sizeof(uint32_t);
output_buffer->u.RGBA.size = output_buffer->u.RGBA.stride * pic->height;
Expand Down

0 comments on commit 3005237

Please sign in to comment.