[vlc-commits] d3d11_fmt: allow creating small textures

Steve Lhomme git at videolan.org
Sun Dec 17 23:18:17 CET 2017


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at videolabs.io> | Fri Dec 15 15:28:05 2017 +0100| [a8a2a349d73076ce5593f4987cb75f0059c293b0] | committer: Jean-Baptiste Kempf

d3d11_fmt: allow creating small textures

For anything smaller than 64 pixels it may give an error due to the width padding.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit 5c81725ea4d513d6f47fcf7dd6e5bea54433489e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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,



More information about the vlc-commits mailing list