[vlc-devel] [PATCH] d3d11_fmt: allow creating small textures

Steve Lhomme robux4 at videolabs.io
Fri Dec 15 15:28:05 CET 2017


For anything smaller than 64 pixels it may give an error due to the width padding.
---
 modules/video_chroma/d3d11_fmt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index cce11fec5b..5f9a5b911a 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -489,7 +489,8 @@ int AllocateTextures( vlc_object_t *obj, d3d11_device_t *d3d_dev,
                      p_chroma_desc->pixel_size * texDesc.Width );
             goto error;
         }
-        if ( mappedResource.RowPitch >=
+        if ( fmt->i_width > 64 &&
+             mappedResource.RowPitch >=
              2* (fmt->i_width * p_chroma_desc->p[0].w.num / p_chroma_desc->p[0].w.den * p_chroma_desc->pixel_size) )
         {
             msg_Err(obj, "Bogus %4.4s pitch detected. %d vs %d", (const char*)&fmt->i_chroma,
-- 
2.14.2



More information about the vlc-devel mailing list