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

smacker audio: sign-extend the initial 16-bit predicted value

Fixes Bug #265

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
This commit is contained in:
Franz Brauße 2012-03-30 14:40:14 -04:00 committed by Justin Ruggles
parent b691fd7a4d
commit 12cbbbb4ab

View File

@ -655,7 +655,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
} }
if(bits) { //decode 16-bit data if(bits) { //decode 16-bit data
for(i = stereo; i >= 0; i--) for(i = stereo; i >= 0; i--)
pred[i] = av_bswap16(get_bits(&gb, 16)); pred[i] = sign_extend(av_bswap16(get_bits(&gb, 16)), 16);
for(i = 0; i <= stereo; i++) for(i = 0; i <= stereo; i++)
*samples++ = pred[i]; *samples++ = pred[i];
for(; i < unp_size / 2; i++) { for(; i < unp_size / 2; i++) {