diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-01-30 02:16:50 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-01-30 02:16:50 +0000 |
commit | bd9ea6a4629622fdc119ded81dcf59d2c449e349 (patch) | |
tree | 0b9277e98869997a53ae2bff72192ff47eeed5ec | |
parent | 4b9ac0b5f070f35eff671d83cee436db40631112 (diff) | |
download | ffmpeg-bd9ea6a4629622fdc119ded81dcf59d2c449e349.tar.gz |
fixing missaligned memory accesses in fill_rectangle()
Originally committed as revision 3901 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h264.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 6025bce727..83464826ea 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -182,14 +182,14 @@ typedef struct H264Context{ * non zero coeff count cache. * is 64 if not available. */ - uint8_t non_zero_count_cache[6*8]; + uint8_t non_zero_count_cache[6*8] __align8; uint8_t (*non_zero_count)[16]; /** * Motion vector cache. */ - int16_t mv_cache[2][5*8][2]; - int8_t ref_cache[2][5*8]; + int16_t mv_cache[2][5*8][2] __align8; + int8_t ref_cache[2][5*8] __align8; #define LIST_NOT_USED -1 //FIXME rename? #define PART_NOT_AVAILABLE -2 @@ -318,7 +318,7 @@ typedef struct H264Context{ uint8_t *chroma_pred_mode_table; int last_qscale_diff; int16_t (*mvd_table[2])[2]; - int16_t mvd_cache[2][5*8][2]; + int16_t mvd_cache[2][5*8][2] __align8; uint8_t *direct_table; uint8_t direct_cache[5*8]; @@ -358,6 +358,7 @@ static inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t v w *= size; stride *= size; + assert((((int)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0); //FIXME check what gcc generates for 64 bit on x86 and possible write a 32 bit ver of it if(w==2 && h==2){ *(uint16_t*)(p + 0)= |