swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] Bug in enumerateUsedIDs for DEFINEBUTTONSOUND


From: Dan Weiss
Subject: [Swftools-common] Bug in enumerateUsedIDs for DEFINEBUTTONSOUND
Date: Thu, 4 Feb 2010 20:29:39 -0600

There is a bug in enumerateUsedIDs found in swftools.c:

    case ST_DEFINEBUTTONSOUND: {
        int t;
        callback(tag, tag->pos + base, callback_data);
        for(t=0;t<4;t++) {
        int flags;
        callback(tag, tag->pos + base, callback_data);
        swf_GetU16(tag); //sound id
        flags = swf_GetU8(tag);
        if(flags&1)
            swf_GetU32(tag); // in point
        if(flags&2)
            swf_GetU32(tag); // out points
        if(flags&4)
            swf_GetU16(tag); // loop count
        if(flags&8)
        {
            int npoints = swf_GetU8(tag);
            int s;
            for(s=0;s<npoints;s++)
            {
            swf_GetU32(tag);
            swf_GetU16(tag);
            swf_GetU16(tag);
            }
        }
        }
        } break;

It should be popping off the first U16 for the button ID, and also check each sound ID to see if it is zero or not.

The code should be:

    case ST_DEFINEBUTTONSOUND: {
        int t;
        callback(tag, tag->pos + base, callback_data);
        int buttonID = swf_GetU16(tag);  //button id     *FIX*
        for(t=0;t<4;t++) {
        int flags;
        callback(tag, tag->pos + base, callback_data);
        int soundID = swf_GetU16(tag); //sound id  *FIX*
        if (soundID != 0)  //  *FIX*
        {
        flags = swf_GetU8(tag);
        if(flags&1)
            swf_GetU32(tag); // in point
        if(flags&2)
            swf_GetU32(tag); // out points
        if(flags&4)
            swf_GetU16(tag); // loop count
        if(flags&8)
        {
            int npoints = swf_GetU8(tag);
            int s;
            for(s=0;s<npoints;s++)
            {
            swf_GetU32(tag);
            swf_GetU16(tag);
            swf_GetU16(tag);
            }
        }
        }
        }
        } break;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]