mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-13 05:31:29 +00:00
Fix undefined behaviour due to shifting signed in snd_mem.c
This commit is contained in:
parent
4ea0eebfe5
commit
a494edeb94
1 changed files with 1 additions and 1 deletions
|
@ -141,7 +141,7 @@ static int ResampleSfx( sfx_t *sfx, int channels, int inrate, int inwidth, int s
|
||||||
if( inwidth == 2 ) {
|
if( inwidth == 2 ) {
|
||||||
sample = ( ((short *)data)[srcsample+j] );
|
sample = ( ((short *)data)[srcsample+j] );
|
||||||
} else {
|
} else {
|
||||||
sample = (int)( (unsigned char)(data[srcsample+j]) - 128) << 8;
|
sample = (unsigned int)( (unsigned char)(data[srcsample+j]) - 128) << 8;
|
||||||
}
|
}
|
||||||
part = (i*channels+j)&(SND_CHUNK_SIZE-1);
|
part = (i*channels+j)&(SND_CHUNK_SIZE-1);
|
||||||
if (part == 0) {
|
if (part == 0) {
|
||||||
|
|
Loading…
Reference in a new issue