Skip to content

Commit

Permalink
d3d11_fmt: detect bogus pitch
Browse files Browse the repository at this point in the history
Fixes #19162

Signed-off-by: Jean-Baptiste Kempf <[email protected]>
  • Loading branch information
robUx4 authored and jbkempf committed Nov 28, 2017
1 parent 870264f commit 676e46d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/video_chroma/d3d11_fmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 676e46d

Please sign in to comment.