d3dx10: Don't check frame count in load_texture_data.

This commit is contained in:
Piotr Caban 2022-07-13 19:30:12 +02:00 committed by Alexandre Julliard
parent 3265019d7c
commit d1c03fe48a

View file

@ -816,7 +816,7 @@ static HRESULT convert_image(IWICImagingFactory *factory, IWICBitmapFrameDecode
HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info,
D3D10_SUBRESOURCE_DATA **resource_data) D3D10_SUBRESOURCE_DATA **resource_data)
{ {
unsigned int frame_count, stride, frame_size, i; unsigned int stride, frame_size, i;
IWICDdsFrameDecode *dds_frame = NULL; IWICDdsFrameDecode *dds_frame = NULL;
IWICBitmapFrameDecode *frame = NULL; IWICBitmapFrameDecode *frame = NULL;
IWICImagingFactory *factory = NULL; IWICImagingFactory *factory = NULL;
@ -873,8 +873,6 @@ HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO
goto end; goto end;
if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder))) if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder)))
goto end; goto end;
if (FAILED(hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count)) || !frame_count)
goto end;
if (img_info.ImageFileFormat == D3DX10_IFF_DDS) if (img_info.ImageFileFormat == D3DX10_IFF_DDS)
{ {