diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-30 19:24:49 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-30 19:43:03 +0100 |
commit | 47f1596ecef3304f20be1be2dc6978989334608f (patch) | |
tree | af937982645751b9474798929b94338a4e9089dd /libavcodec/dxtory.c | |
parent | e91ba2efa949470e9157b652535d207a101f91e0 (diff) | |
download | ffmpeg-47f1596ecef3304f20be1be2dc6978989334608f.tar.gz |
avcodec/dxtory: use unaligned copy for unaligned addresses
Fixes undefined behavior
Fixes: asan_heap-oob_112c6b3_13_012.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dxtory.c')
-rw-r--r-- | libavcodec/dxtory.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index ee5d7313cc..4d8b7b29a6 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -82,10 +82,10 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic, V = pic->data[2]; for (h = 0; h < avctx->height; h += 4) { for (w = 0; w < avctx->width; w += 4) { - AV_COPY32(Y1 + w, src); - AV_COPY32(Y2 + w, src + 4); - AV_COPY32(Y3 + w, src + 8); - AV_COPY32(Y4 + w, src + 12); + AV_COPY32U(Y1 + w, src); + AV_COPY32U(Y2 + w, src + 4); + AV_COPY32U(Y3 + w, src + 8); + AV_COPY32U(Y4 + w, src + 12); U[w >> 2] = src[16] + 0x80; V[w >> 2] = src[17] + 0x80; src += 18; |