changeset 9857:964d08f7b46f libavcodec

Fix unaligned accesses by doing bytewise access until aligned, then continuing in 32-bit quantities. Fixes crash observed on sparc during FATE mlp test. Patch by Ramiro.
author heydowns
date Mon, 15 Jun 2009 14:38:30 +0000
parents ff2358195bc7
children 53d5914a30ef
files mlp.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mlp.c	Sun Jun 14 22:41:30 2009 +0000
+++ b/mlp.c	Mon Jun 15 14:38:30 2009 +0000
@@ -96,6 +96,8 @@
     uint32_t scratch = 0;
     const uint8_t *buf_end = buf + buf_size;
 
+    for (; ((intptr_t) buf & 3) && buf < buf_end; buf++)
+        scratch ^= *buf;
     for (; buf < buf_end - 3; buf += 4)
         scratch ^= *((const uint32_t*)buf);