Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
+ if (image->format == D3DFMT_P8 || is_rle || bottom_to_top || right_to_left) + return E_NOTIMPL; + + hr = d3dx_calculate_pixels_size(image->format, image->size.width, image->size.height, &row_pitch, &slice_pitch); + if (FAILED(hr)) + return hr; + + /* File is too small. */ + if ((src_header_size + slice_pitch) > src_data_size) + return D3DXERR_INVALIDDATA; + + image->pixels = (uint8_t *)src_data + src_header_size; + return D3D_OK; +} + +static HRESULT d3dx_initialize_image_from_tga(const void *src_data, uint32_t src_data_size, struct d3dx_image *image, uint32_t flags) Nitpick, this line is a bit on the long side (not that I mind particularly but it's kinda noticeable when the others stick to under 100-120 columns).
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6688#note_85438