mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-31 03:44:15 +00:00
libavutil/hwcontext_dxva2: Add check for possible errors from GetAdapterDisplayModeEx
This prevents a possible crash in CreateDeviceEx when using faulty response from GetAdapterDisplayModeEx and allows ffmpeg to fallback to classic d3d9. Signed-off-by: wm4 <nfxjfg@googlemail.com>
This commit is contained in:
parent
1b283c4a0d
commit
59b126f922
@ -485,7 +485,11 @@ static int dxva2_device_create9ex(AVHWDeviceContext *ctx, UINT adapter)
|
||||
if (FAILED(hr))
|
||||
return AVERROR_UNKNOWN;
|
||||
|
||||
IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, adapter, &modeex, NULL);
|
||||
hr = IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, adapter, &modeex, NULL);
|
||||
if (FAILED(hr)) {
|
||||
IDirect3D9Ex_Release(d3d9ex);
|
||||
return AVERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
d3dpp.BackBufferFormat = modeex.Format;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user