diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-19 23:55:16 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-20 00:26:59 +0300 |
commit | 36a87c2dc7f302da3778bd0cff050b5c93a730c7 (patch) | |
tree | 134b4e7fc0cc37fb70cc573701c8340299af04c4 | |
parent | 4ebe31abf1b48b86300d11bd0421d47b762c4bd2 (diff) |
avcodec/dds: fix paletted files
Fixes Ticket4664
The changed fate tests lack red/blue shades and thus look correct
either way
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/dds.c | 10 | ||||
-rw-r--r-- | tests/ref/fate/dds-pal | 2 | ||||
-rw-r--r-- | tests/ref/fate/dds-pal-ati | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/dds.c b/libavcodec/dds.c index 3f6f7f8cb7..566954ddd9 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -629,9 +629,13 @@ static int dds_decode(AVCodecContext *avctx, void *data, int i; /* Use the first 1024 bytes as palette, then copy the rest. */ bytestream2_get_buffer(gbc, frame->data[1], 256 * 4); - if (HAVE_BIGENDIAN) - for (i = 0; i < 256; i++) - AV_WB32(frame->data[1] + i*4, AV_RL32(frame->data[1] + i*4)); + for (i = 0; i < 256; i++) + AV_WN32(frame->data[1] + i*4, + (frame->data[1][2+i*4]<<0)+ + (frame->data[1][1+i*4]<<8)+ + (frame->data[1][0+i*4]<<16)+ + (frame->data[1][3+i*4]<<24) + ); frame->palette_has_changed = 1; } diff --git a/tests/ref/fate/dds-pal b/tests/ref/fate/dds-pal index 85414414d5..575a4bd51b 100644 --- a/tests/ref/fate/dds-pal +++ b/tests/ref/fate/dds-pal @@ -1,2 +1,2 @@ #tb 0: 1/25 -0, 0, 0, 1, 65536, 0xbffee5cd +0, 0, 0, 1, 65536, 0x4287e5cd diff --git a/tests/ref/fate/dds-pal-ati b/tests/ref/fate/dds-pal-ati index 6b43bb4a8b..6de8adb445 100644 --- a/tests/ref/fate/dds-pal-ati +++ b/tests/ref/fate/dds-pal-ati @@ -1,2 +1,2 @@ #tb 0: 1/25 -0, 0, 0, 1, 16384, 0x23068060 +0, 0, 0, 1, 16384, 0x6ac18060 |