[FFmpeg-devel] [PATCH]: h264: Fix unaligned access crashes on sparc.

David Miller davem
Fri Feb 27 15:53:53 CET 2009


sub_mb_type[] needs to be 8-byte aligned because it is referenced
as a uint64_t in get_dct8x8_allowed().

Signed-off-by: David S. Miller <davem at davemloft.net>

diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 3cfa70a..587f1e3 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -350,7 +350,7 @@ typedef struct H264Context{
     int mb_field_decoding_flag;
     int mb_mbaff;              ///< mb_aff_frame && mb_field_decoding_flag
 
-    uint16_t sub_mb_type[4];
+    DECLARE_ALIGNED_8(uint16_t, sub_mb_type[4]);
 
     //POC stuff
     int poc_lsb;




More information about the ffmpeg-devel mailing list