avcodec/dcaenc: Fix undefined left shift of negative numbers

Affected the acodec-dca and acodec-dca2 FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
pull/362/head
Andreas Rheinhardt 4 years ago committed by Andreas Rheinhardt
parent 0c7d02844c
commit 659a925939
  1. 8
      libavcodec/dcaenc.c

@ -925,10 +925,10 @@ static void fill_in_adpcm_bufer(DCAEncContext *c)
* But there are no proper value in decoder history, so likely result will be no good.
* Bitstream has "Predictor history flag switch", but this flag disables history for all subbands
*/
samples[0] = c->adpcm_history[ch][band][0] << 7;
samples[1] = c->adpcm_history[ch][band][1] << 7;
samples[2] = c->adpcm_history[ch][band][2] << 7;
samples[3] = c->adpcm_history[ch][band][3] << 7;
samples[0] = c->adpcm_history[ch][band][0] * (1 << 7);
samples[1] = c->adpcm_history[ch][band][1] * (1 << 7);
samples[2] = c->adpcm_history[ch][band][2] * (1 << 7);
samples[3] = c->adpcm_history[ch][band][3] * (1 << 7);
}
}
}

Loading…
Cancel
Save