Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212852 - media-libs/libmikmod-3.1.11-r5 segfault when loading truncated XM file
Summary: media-libs/libmikmod-3.1.11-r5 segfault when loading truncated XM file
Status: RESOLVED DUPLICATE of bug 255363
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: High normal
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-09 18:16 UTC by scratch
Modified: 2009-07-19 20:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description scratch 2008-03-09 18:16:17 UTC
When I do mpd --create-db on mods downloaded from scene.org, it crashes inside libmikmod.  The problem is that of.samples == NULL after l->Load() has finished, in playercode/mloader.c: 
 
    /* init module loader and load the header / patterns */
    if (!l->Init || l->Init()) {
        _mm_rewind(modreader);
        ok = l->Load(curious);
        /* propagate inflags=flags for in-module samples */
        for (t = 0; t < of.numsmp; t++)
            if (of.samples[t].inflags == 0)
                of.samples[t].inflags = of.samples[t].flags;
    } else
        ok = 0;

I believe this is fixed in the latest mikmod CVS on sourceforge.net, but it has not been incorporated into portage:

    /* init module loader and load the header / patterns */
    if (!l->Init || l->Init()) {
        _mm_rewind(modreader);
        ok = l->Load(curious);
        if (ok) {
            /* propagate inflags=flags for in-module samples */
            for (t = 0; t < of.numsmp; t++)
                if (of.samples[t].inflags == 0)
                    of.samples[t].inflags = of.samples[t].flags;
        }
    } else
        ok = 0;

Reproducible: Always

Steps to Reproduce:
Load a truncated .xm file with libmikmod.
Actual Results:  
Segfault trying to access of.samples in playercode/mloader.c

Expected Results:  
The .xm is loaded

The bug is fixed in upstream CVS.
Comment 1 scratch 2008-03-09 21:42:13 UTC
Note, however, that the CVS libmikmod breaks API, so I propose that this be included as a patch.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2009-07-19 20:31:41 UTC

*** This bug has been marked as a duplicate of bug 255363 ***