[vlc-commits] d3d11_fmt: fix crash when the feature level doesn't match

Steve Lhomme git at videolan.org
Wed Oct 18 13:58:06 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Oct 18 13:56:33 2017 +0200| [709704c0b35ae52ef3372039faca31cf2a92ccd1] | committer: Jean-Baptiste Kempf

d3d11_fmt: fix crash when the feature level doesn't match

Also log the feature level as hexadecimal, it's easier to read.

Fixes #18941

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=709704c0b35ae52ef3372039faca31cf2a92ccd1
---

 modules/video_chroma/d3d11_fmt.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 0939ab4846..f3782004a2 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -212,11 +212,12 @@ static inline HRESULT D3D11_CreateDevice(vlc_object_t *obj, HINSTANCE hdecoder_d
             /* we can work with legacy levels but only if forced */
             if ( obj->obj.force || i_feature_level >= D3D_FEATURE_LEVEL_11_1 )
                 break;
-            msg_Dbg(obj, "Incompatible feature level %i", i_feature_level);
+            msg_Dbg(obj, "Incompatible feature level %x", i_feature_level);
             ID3D11DeviceContext_Release(*pp_d3dcontext);
             *pp_d3dcontext = NULL;
             ID3D11Device_Release(*pp_d3ddevice);
             *pp_d3ddevice = NULL;
+            hr = E_NOTIMPL;
         }
     }
     return hr;



More information about the vlc-commits mailing list