diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-13 18:21:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-13 18:21:51 +0200 |
commit | 2ec8789eb8f28a3e99dde329a6a36f25b68f89c4 (patch) | |
tree | 4adff5abef265f34e591f742ede033dbde4d61c2 | |
parent | 84d74610f9d27077e9260b544ae52d732e92e5de (diff) | |
download | ffmpeg-2ec8789eb8f28a3e99dde329a6a36f25b68f89c4.tar.gz |
avpicture_layout: use a endian independant format for the palette.
This should fix the failing fate PAL8 tests.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/imgconvert.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index c26e5b6479..76d75aaafe 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -340,8 +340,11 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, return size; } - if (desc->flags & PIX_FMT_PAL) - memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4); + if (desc->flags & PIX_FMT_PAL) { + uint32_t *d32 = (unsigned char *)(((size_t)dest + 3) & ~3); + for (i = 0; i<256; i++) + AV_WL32(d32 + i, AV_RN32(src->data[1] + 4*i)); + } return size; } |