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

Stefan Gehrer stefan.gehrer
Sat Feb 28 09:42:09 CET 2009


David Miller wrote:
> 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;

I allowed myself to apply this, as both the cause and the fix
seemed trivial enough.

Stefan




More information about the ffmpeg-devel mailing list