Skip to content

Commit

Permalink
Fix undefined behaviour due to shifting signed in snd_mem.c
Browse files Browse the repository at this point in the history
  • Loading branch information
lonkamikaze authored and zturtleman committed Apr 9, 2018
1 parent 4ea0eeb commit a494ede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/client/snd_mem.c
Expand Up @@ -141,7 +141,7 @@ static int ResampleSfx( sfx_t *sfx, int channels, int inrate, int inwidth, int s
if( inwidth == 2 ) {
sample = ( ((short *)data)[srcsample+j] );
} 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);
if (part == 0) {
Expand Down

0 comments on commit a494ede

Please sign in to comment.