Fix colour shift in Crop function due to not multiplying x position by colours

This commit is contained in:
Isaac Connor 2021-02-02 23:19:06 -05:00
parent 49e9bf86fa
commit f868d92269
1 changed files with 1 additions and 1 deletions

View File

@ -1467,7 +1467,7 @@ bool Image::Crop( unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsig
uint8_t *new_buffer = AllocBuffer(new_size);
for ( unsigned int y = lo_y, ny = 0; y <= hi_y; y++, ny++ ) {
unsigned char *pbuf = &buffer[((y*linesize)+lo_x)];
unsigned char *pbuf = &buffer[((y*linesize)+(lo_x*colours))];
unsigned char *pnbuf = &new_buffer[ny*new_stride];
memcpy(pnbuf, pbuf, new_stride);
}