Skip to content

Commit 5c79f4c

Browse files
thouravislouken
authored andcommitted
Incorrect bfOffBits Calculation in WIN_ConvertDIBtoBMP
1 parent 70d23b2 commit 5c79f4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/video/windows/SDL_windowsclipboard.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void *WIN_ConvertDIBtoBMP(HANDLE hMem, size_t *size)
145145
pbfh->bfSize = (DWORD)bmp_size;
146146
pbfh->bfReserved1 = 0;
147147
pbfh->bfReserved2 = 0;
148-
pbfh->bfOffBits = (DWORD)(sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + color_table_size);
148+
pbfh->bfOffBits = (DWORD)(sizeof(BITMAPFILEHEADER) + pbih->biSize + color_table_size);
149149
SDL_memcpy((Uint8 *)bmp + sizeof(BITMAPFILEHEADER), dib, dib_size);
150150
*size = bmp_size;
151151
}

0 commit comments

Comments
 (0)