aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Mitrofanov <BugMaster@narod.ru>2011-07-10 20:07:43 +0400
committerRonald S. Bultje <rsbultje@gmail.com>2011-07-10 14:52:21 -0700
commit142e76f1055de5dde44696e71a5f63f2cb11dedf (patch)
treeb9c21ee1b84ada92f3c8b4a92c9e68bdabd5d69b
parentfdb94444beb9c32beb8cfc70656f5115d9eec58b (diff)
downloadffmpeg-142e76f1055de5dde44696e71a5f63f2cb11dedf.tar.gz
swscale: fix crash with dithering due incorrect offset calculation.
ptrdiff_t can be 4 bytes, which leads to the next element being 4-byte aligned and thus at a different offset than intended. Forcing 8-byte alignment forces equal offset of dither16/32 on x86-32 and x86-64. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
-rw-r--r--libswscale/swscale_internal.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index b602541044..9492303301 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -345,10 +345,13 @@ typedef struct SwsContext {
DECLARE_ALIGNED(8, uint64_t, v_temp);
DECLARE_ALIGNED(8, uint64_t, y_temp);
int32_t alpMmxFilter[4*MAX_FILTER_SIZE];
+ // alignment of these values is not necessary, but merely here
+ // to maintain the same offset across x8632 and x86-64. Once we
+ // use proper offset macros in the asm, they can be removed.
DECLARE_ALIGNED(8, ptrdiff_t, uv_off_px); ///< offset (in pixels) between u and v planes
DECLARE_ALIGNED(8, ptrdiff_t, uv_off_byte); ///< offset (in bytes) between u and v planes
- uint16_t dither16[8];
- uint32_t dither32[8];
+ DECLARE_ALIGNED(8, uint16_t, dither16)[8];
+ DECLARE_ALIGNED(8, uint32_t, dither32)[8];
const uint8_t *chrDither8, *lumDither8;