Commit 676e46d8 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

d3d11_fmt: detect bogus pitch

Fixes #19162
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 870264fa
......@@ -412,6 +412,14 @@ int AllocateTextures( vlc_object_t *obj, d3d11_device_t *d3d_dev,
p_chroma_desc->pixel_size * texDesc.Width );
goto error;
}
if ( 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,
mappedResource.RowPitch,
(fmt->i_width * p_chroma_desc->p[0].w.num / p_chroma_desc->p[0].w.den * p_chroma_desc->pixel_size));
goto error;
}
}
if (slicedTexture)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment