changeset 9158:0d5eed0f1b45 libavcodec

Fix unaligned access in ff_copy_bits()
author mru
date Mon, 09 Mar 2009 23:27:38 +0000
parents 33477a19f89e
children 7a9a124bbc06
files bitstream.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bitstream.c	Mon Mar 09 22:00:35 2009 +0000
+++ b/bitstream.c	Mon Mar 09 23:27:38 2009 +0000
@@ -83,7 +83,7 @@
     if(length==0) return;
 
     if(CONFIG_SMALL || words < 16 || put_bits_count(pb)&7){
-        for(i=0; i<words; i++) put_bits(pb, 16, be2me_16(srcw[i]));
+        for(i=0; i<words; i++) put_bits(pb, 16, AV_RB16(&srcw[i]));
     }else{
         for(i=0; put_bits_count(pb)&31; i++)
             put_bits(pb, 8, src[i]);
@@ -92,7 +92,7 @@
         skip_put_bytes(pb, 2*words-i);
     }
 
-    put_bits(pb, bits, be2me_16(srcw[words])>>(16-bits));
+    put_bits(pb, bits, AV_RB16(&srcw[words])>>(16-bits));
 }
 
 /* VLC decoding */