[MPlayer-users] Bugs in file demux_mkv.c(big/small endian problem)

Qing Wang wqfrank at 163.com
Wed May 18 08:30:58 CEST 2005

    I think the following line in file demux_mkv.c will make mplayer  
crash in MacOSX.

static void handle_realvideo (demuxer_t *demuxer, mkv_track_t *track,  
uint8_t *buffer,
                   uint32_t size, int block_bref)
   memcpy (dp->buffer + sizeof(*hdr), buffer +(chunks+1)*8, isize);
   memcpy (dp->buffer + sizeof(*hdr) + isize, buffer, (chunks+1)*8);

    since chunks in real video is 32-bits integers, here we use bytes- 
copy(memcpy) to copy the chunks value to the data block. This works  
well if the mkv is created and used on platform with integer store  
format( both small endian or both big endian). But as the MacOSX  
platform uses big-endian integer store format and the integer store  
format in mkv files is in small-endian format, so the format copy  
method will changes the chunks's value sent to the decoder and make  
mplayer crashes.

                                         Yours Sincerely
                                         Qing Wang

More information about the MPlayer-users mailing list