[FFmpeg-cvslog] r17921 - trunk/libavcodec/bitstream.c

mru subversion
Tue Mar 10 00:27:40 CET 2009


Author: mru
Date: Tue Mar 10 00:27:38 2009
New Revision: 17921

Log:
Fix unaligned access in ff_copy_bits()

Modified:
   trunk/libavcodec/bitstream.c

Modified: trunk/libavcodec/bitstream.c
==============================================================================
--- trunk/libavcodec/bitstream.c	Mon Mar  9 23:39:49 2009	(r17920)
+++ trunk/libavcodec/bitstream.c	Tue Mar 10 00:27:38 2009	(r17921)
@@ -83,7 +83,7 @@ void ff_copy_bits(PutBitContext *pb, con
     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 @@ void ff_copy_bits(PutBitContext *pb, con
         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 */




More information about the ffmpeg-cvslog mailing list