New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #21741: patch-src-adpcm.c.diff

File patch-src-adpcm.c.diff, 1.0 KB (added by null.atou@…, 3 years ago)

patch for src/adpcm.c

  • src/adpcm.c

    old new  
    149148                top = obuff + n*chans; 
    150149 
    151150                ch = 0; 
    152                 while (op < top) { 
     151    while (op < top) { /*** N.B. Without int casts, crashes on 64-bit arch ***/ 
    153152                        b = *ip++; 
    154153                        tmp = op; 
    155                         *op++ = AdpcmDecode(b >> 4, state+ch, tmp[-chans], tmp[-(2*chans)]); 
     154      *op++ = AdpcmDecode(b >> 4, state+ch, tmp[-(int)chans], tmp[-(int)(2*chans)]); 
    156155                        if (++ch == chans) ch = 0; 
    157                         /* ch = ++ch % chans; */ 
    158156                        tmp = op; 
    159                         *op++ = AdpcmDecode(b&0x0f, state+ch, tmp[-chans], tmp[-(2*chans)]); 
     157      *op++ = AdpcmDecode(b&0x0f, state+ch, tmp[-(int)chans], tmp[-(int)(2*chans)]); 
    160158                        if (++ch == chans) ch = 0; 
    161                         /* ch = ++ch % chans; */ 
    162159                } 
    163160        } 
    164161        return errmsg;