big endian compile fix by ("Ronald S. Bultje" <R dot S dot Bultje at students dot...
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Mar 2004 02:26:01 +0000 (02:26 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Mar 2004 02:26:01 +0000 (02:26 +0000)
Originally committed as revision 2873 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroska.c

index 7fcc3c9..f8942ae 100644 (file)
@@ -624,10 +624,10 @@ ebml_read_float (MatroskaDemuxContext *matroska,
     if (size == 4) {
         float f;
 
+        while (size-- > 0)
 #ifdef WORDS_BIGENDIAN
-        f = * (float *) data;
+            ((uint8_t *) &f)[3 - size] = get_byte(pb);
 #else
-        while (size-- > 0)
             ((uint8_t *) &f)[size] = get_byte(pb);
 #endif
 
@@ -635,10 +635,10 @@ ebml_read_float (MatroskaDemuxContext *matroska,
     } else {
         double d;
 
+        while (size-- > 0)
 #ifdef WORDS_BIGENDIAN
-        d = * (double *) data;
+            ((uint8_t *) &d)[7 - size] = get_byte(pb);
 #else
-        while (size-- > 0)
             ((uint8_t *) &d)[size] = get_byte(pb);
 #endif