Commit 2ec8789e authored by Michael Niedermayer's avatar Michael Niedermayer

avpicture_layout: use a endian independant format for the palette.

This should fix the failing fate PAL8 tests.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 84d74610
...@@ -340,8 +340,11 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, ...@@ -340,8 +340,11 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
return size; return size;
} }
if (desc->flags & PIX_FMT_PAL) if (desc->flags & PIX_FMT_PAL) {
memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4); 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; return size;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment