internal/graphicsdriver/directx: early error check for Wine

Updates #2114
This commit is contained in:
Hajime Hoshi 2022-07-19 23:55:42 +09:00
parent f8acd5e7ee
commit e861080145

View File

@ -1047,6 +1047,9 @@ func (g *Graphics) NewImage(width, height int) (graphicsdriver.Image, error) {
}
layouts, _, _, totalBytes := g.device.GetCopyableFootprints(&desc, 0, 1, 0)
if totalBytes == 1<<64-1 {
return nil, fmt.Errorf("directx: GetCopyableFootprints returned an invalid total bytes")
}
i := &Image{
graphics: g,