Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix left shift of a negative value in SWFInput_readSBits. Check for n…
…umber before before left-shifting by (number-1).
  • Loading branch information
Yoha-test authored and strk committed Jul 12, 2020
1 parent da9d86e commit a009a38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/input.c
Expand Up @@ -113,7 +113,7 @@ SWFInput_readSBits(SWFInput input, int number)
{
int num = SWFInput_readBits(input, number);

if ( num & (1<<(number-1)) )
if(number && num & (1<<(number-1)))
return num - (1<<number);
else
return num;
Expand Down

0 comments on commit a009a38

Please sign in to comment.