Musepack Forums

Musepack Forums (https://forum.musepack.net/index.php)
-   Development (https://forum.musepack.net/forumdisplay.php?f=11)
-   -   libmpcdec 1.2.2 crash (https://forum.musepack.net/showthread.php?t=286)

Zenitram 29 April 2006 06:12 pm

libmpcdec 1.2.2 crash
 
with this file :
http://mediaarea.net/crash.mpc
If I use libmpcdec 1.2.2, I have a crash with this code :
Code:

mpc_streaminfo Info;
(...)
if (Info.profile_name)
  std::string S=Info.profile_name;

Note that Info.profile is 494.
I think you do not check the value of profile when you map it with a char* for the profile name.
I don't know why the profile is so high.

Lefungus 30 April 2006 11:56 am

Which code are you talking about ? There's no std::string in libmpcdec.
After a quick look at the sources, libmpcdec does check invalid profile id and use "n.a." as profile_name

Zenitram 30 April 2006 10:56 pm

Quote:

Originally Posted by Lefungus
Which code are you talking about ? There's no std::string in libmpcdec.
After a quick look at the sources, libmpcdec does check invalid profile id and use "n.a." as profile_name

std::string is my code, sorry I have not be enough explicit
Code:

    FILE *File=_wfopen(CompleteFileName.c_str(), L"rb");
    if (!File)
        return -1;
    mpc_reader_file Reader;
    mpc_reader_setup_file_reader(&Reader, File);

    mpc_streaminfo Info;
    mpc_streaminfo_init(&Info);
    if (mpc_streaminfo_read(&Info, &Reader.reader)!=ERROR_CODE_OK)
    {
        fclose(File);
        return -1; //Not a Musepack file
    }
    if (Info.profile_name)
      std::string S=Info.profile_name;

And with the the given file, it crashes, maybe not for the reason I suspected.
would you like I give you an example complete source code?


All times are GMT. The time now is 06:59 am.

Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2020, vBulletin Solutions Inc.