Skip to content
Permalink
Browse files Browse the repository at this point in the history
libvncserver: scale: cast to 64 bit before shifting
Since pixel_value is 64 bit the data type of the shift operand should
be 64 bit too to prevent integer overflows.
  • Loading branch information
tobydox committed May 28, 2020
1 parent 67944bf commit a6788d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libvncserver/scale.c
Expand Up @@ -210,7 +210,7 @@ void rfbScaledScreenUpdateRect(rfbScreenInfoPtr screen, rfbScreenInfoPtr ptr, in
default:
/* fixme: endianness problem? */
for (z = 0; z < bytesPerPixel; z++)
pixel_value += (srcptr2[z] << (8 * z));
pixel_value += ((unsigned long)srcptr2[z] << (8 * z));
break;
}
/*
Expand Down

0 comments on commit a6788d1

Please sign in to comment.