1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Andreas Rheinhardt 2021-03-26 06:03:49 +01:00 committed by Andreas Rheinhardt
parent 0c7d02844c
commit 659a925939

View File

@ -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);
}
}
}