aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/iff.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-01-26 14:37:08 +0000
committerPaul B Mahol <onemda@gmail.com>2013-01-27 10:59:58 +0000
commit07a7145d89fb2dcf7c85b36f10306cea5f2027d4 (patch)
tree1bc444fc46c07c575a792f50c7be6ded146bc54d /libavcodec/iff.c
parentf9abeecd94cfa335bf43e2a19b60fb990a46644f (diff)
downloadffmpeg-07a7145d89fb2dcf7c85b36f10306cea5f2027d4.tar.gz
lavc/iff: rgbn: fix decoding on big endian
Fixes #2193. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r--libavcodec/iff.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index ac23cc7041..6b1fd89d6b 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -488,7 +488,7 @@ static int decode_byterun(uint8_t *dst, int dst_size,
return buf - buf_start;
}
-#define DECODE_RGBX_COMMON(pixel_size) \
+#define DECODE_RGBX_COMMON(type) \
if (!length) { \
length = bytestream2_get_byte(gb); \
if (!length) { \
@@ -498,7 +498,7 @@ static int decode_byterun(uint8_t *dst, int dst_size,
} \
} \
for (i = 0; i < length; i++) { \
- *(uint32_t *)(dst + y*linesize + x * pixel_size) = pixel; \
+ *(type *)(dst + y*linesize + x * sizeof(type)) = pixel; \
x += 1; \
if (x >= width) { \
y += 1; \
@@ -521,7 +521,7 @@ static void decode_rgb8(GetByteContext *gb, uint8_t *dst, int width, int height,
while (bytestream2_get_bytes_left(gb) >= 4) {
uint32_t pixel = 0xFF000000 | bytestream2_get_be24(gb);
length = bytestream2_get_byte(gb) & 0x7F;
- DECODE_RGBX_COMMON(4)
+ DECODE_RGBX_COMMON(uint32_t)
}
}
@@ -539,7 +539,7 @@ static void decode_rgbn(GetByteContext *gb, uint8_t *dst, int width, int height,
uint32_t pixel = bytestream2_get_be16u(gb);
length = pixel & 0x7;
pixel >>= 4;
- DECODE_RGBX_COMMON(2)
+ DECODE_RGBX_COMMON(uint16_t)
}
}