[FFmpeg-devel] [PATCH] Fix unaligned access in lcl decoder

Jeff Downs heydowns
Wed May 27 18:22:19 CEST 2009


FATE test 289 (http://fate.multimedia.cx/index.php?test_spec=289) 
currently crashes on Sparc/Solaris due to unaligned memory accesses in the 
lcl decoder.

Attached fixes by using memcpy instead of integer copies on platforms 
without fast unaligned access.

	-Jeff
-------------- next part --------------
Index: libavcodec/lcldec.c
===================================================================
--- libavcodec/lcldec.c	(revision 18893)
+++ libavcodec/lcldec.c	(working copy)
@@ -129,7 +129,11 @@
         if ((mask & (1 << (--maskbit))) == 0) {
             if (destptr + 4 > destptr_end)
                 break;
+#if HAVE_FAST_UNALIGNED
             *(int*)destptr = *(int*)srcptr;
+#else
+            memcpy(destptr, srcptr, 4);
+#endif
             srclen -= 4;
             destptr += 4;
             srcptr += 4;



More information about the ffmpeg-devel mailing list