#20 Not Big Endian safe

open
nobody
None
5
2014-05-29
2009-06-29
sandrotosi
No

Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426699

mp3val is not big endian safe.

Lines like
*((unsigned char *)&bitrate_index)=((baseptr[index+2])>>4)&0x0F;
(329: mpegparse.cpp)
make the Program crash on PowerPC (and every other big endian architecture).

For bitrate of 128 the bitrate_index should point to 9, but it points to
150994944.

I also checked version 1.7, but it has the same problems.

Discussion

  • C

    C - 2014-05-29

    Same here with 0.1.8 on Debian/powerpc:

    $ mp3val file.mp3
    Analyzing file "file.mp3"...
    Segmentation fault (core dumped)
    

    The coredump has:

    (gdb) bt
    #0  0x100027c0 in ValidateMPEGFrame (baseptr=baseptr@entry=0xb77ff000 <Address 0xb77ff000="" out="" of="" bounds="">, index=index@entry=1242, mpginfo=mpginfo@entry=0xbfe701ac)
        at mpegparse.cpp:339
    #1  0x10003600 in ValidateFile (baseptr=0xb77ff000 <Address 0xb77ff000="" out="" of="" bounds="">, iFileSize=41075, mpginfo=0xbfe701ac, out=0x10017500, 
        filename=0x100175fc "/tmp/file.mp3", fix=<optimized out="">, hFile=-1) at mpegparse.cpp:106
    #2  0x10001ed0 in ProcessFile (szFileName=szFileName@entry=0xbfe7229e "file.mp3", szLogFileName=<optimized out="">) at main.cpp:201
    #3  0x1000147c in main (argc=2, argv=<optimized out="">) at main.cpp:157
    
     
  • C

    C - 2014-05-29

    Oh, this is actually a duplicate of [#7], reported even two years earlier...

     

    Related

    Bugs: #7


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks