aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-18 20:15:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-28 02:42:14 +0200
commitdd141a50ccb3913d6e9b46478cac7a640e76ddc4 (patch)
tree407a0b5ff67ee18dcb3bdaa8ee18126297d60a74
parent568c1b8166b111d41e6b416e6d98244072fb087a (diff)
downloadffmpeg-dd141a50ccb3913d6e9b46478cac7a640e76ddc4.tar.gz
postproc: fix unaligned access
QP_store is only 8-bit-aligned, so accessing it as uint32_t causes SIGBUS crashes on sparc. The AV_RN32/AV_WN32 macros only do unaligned access in the HAVE_FAST_UNALIGNED case. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 590743101dc934043f34013f1c9bb9fb261355b0) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libpostproc/postprocess.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index c11debcd70..1b90a516a6 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -76,6 +76,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
#include "config.h"
#include "libavutil/avutil.h"
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1024,7 +1025,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
int i;
const int count= FFMAX(mbHeight * QPStride, mbWidth);
for(i=0; i<(count>>2); i++){
- ((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F;
+ AV_WN32(c->nonBQPTable + (i<<2), AV_RN32(QP_store + (i<<2)) & 0x3F3F3F3F);
}
for(i<<=2; i<count; i++){
c->nonBQPTable[i] = QP_store[i] & 0x3F;