Revision 8c2a4ddc

View differences:

libavcodec/adpcm.c
1215 1215
            src++;
1216 1216

  
1217 1217
            for (count2 = 0; count2 < 28; count2++) {
1218
                next_left_sample = (((*src & 0xF0) << 24) >> shift_left);
1219
                next_right_sample = (((*src & 0x0F) << 28) >> shift_right);
1218
                next_left_sample  = (int32_t)((*src & 0xF0) << 24) >> shift_left;
1219
                next_right_sample = (int32_t)((*src & 0x0F) << 28) >> shift_right;
1220 1220
                src++;
1221 1221

  
1222 1222
                next_left_sample = (next_left_sample +
......
1289 1289

  
1290 1290
                    for (count2=0; count2<28; count2++) {
1291 1291
                        if (count2 & 1)
1292
                            next_sample = ((*srcC++ & 0x0F) << 28) >> shift;
1292
                            next_sample = (int32_t)((*srcC++ & 0x0F) << 28) >> shift;
1293 1293
                        else
1294
                            next_sample = ((*srcC   & 0xF0) << 24) >> shift;
1294
                            next_sample = (int32_t)((*srcC   & 0xF0) << 24) >> shift;
1295 1295

  
1296 1296
                        next_sample += (current_sample  * coeff1) +
1297 1297
                                       (previous_sample * coeff2);
......
1336 1336
                s = &samples[m*avctx->channels + channel];
1337 1337
                for (n=0; n<4; n++, src++, s+=32*avctx->channels) {
1338 1338
                    for (s2=s, i=0; i<8; i+=4, s2+=avctx->channels) {
1339
                        int level = ((*src & (0xF0>>i)) << (24+i)) >> shift[n];
1339
                        int level = (int32_t)((*src & (0xF0>>i)) << (24+i)) >> shift[n];
1340 1340
                        int pred  = s2[-1*avctx->channels] * coeff[0][n]
1341 1341
                                  + s2[-2*avctx->channels] * coeff[1][n];
1342 1342
                        s2[0] = av_clip_int16((level + pred + 0x80) >> 8);

Also available in: Unified diff