# HG changeset patch # User michael # Date 1187011216 0 # Node ID 9b20d2534c97597f59df708553bf9ab06b5ee8a3 # Parent 1c67999f81c8f3f4284fabb8301ac18c6060b75d use bytestream_get_le*() this also fixes a big endian bug diff -r 1c67999f81c8 -r 9b20d2534c97 4xm.c --- a/4xm.c Mon Aug 13 05:36:50 2007 +0000 +++ b/4xm.c Mon Aug 13 13:20:16 2007 +0000 @@ -27,6 +27,7 @@ #include "avcodec.h" #include "dsputil.h" #include "mpegvideo.h" +#include "bytestream.h" //#undef NDEBUG //#include @@ -597,8 +598,8 @@ unsigned int color[4], bits; memset(color, 0, sizeof(color)); //warning following is purely guessed ... - color[0]= AV_RN16(buf); buf+=2; //FIXME use bytestream - color[1]= AV_RN16(buf); buf+=2; + color[0]= bytestream_get_le16(&buf); + color[1]= bytestream_get_le16(&buf); if(color[0]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 1\n"); if(color[1]&0x8000) av_log(NULL, AV_LOG_ERROR, "unk bit 2\n"); @@ -606,7 +607,7 @@ color[2]= mix(color[0], color[1]); color[3]= mix(color[1], color[0]); - bits= AV_RL32(buf); buf+= 4; + bits= bytestream_get_le32(&buf); for(y2=0; y2<16; y2++){ for(x2=0; x2<16; x2++){ int index= 2*(x2>>2) + 8*(y2>>2);