Commit 200bfa97 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10: Validate the base offset in parse_fx10_body() (AFL).

parent e36630f7
......@@ -2104,10 +2104,17 @@ static void d3d10_effect_type_destroy(struct wine_rb_entry *entry, void *context
static HRESULT parse_fx10_body(struct d3d10_effect *e, const char *data, DWORD data_size)
{
const char *ptr = data + e->index_offset;
const char *ptr;
unsigned int i;
HRESULT hr;
if (e->index_offset >= data_size)
{
WARN("Invalid index offset %#x (data size %#x).\n", e->index_offset, data_size);
return E_FAIL;
}
ptr = data + e->index_offset;
if (!(e->local_buffers = d3d10_calloc(e->local_buffer_count, sizeof(*e->local_buffers))))
{
ERR("Failed to allocate local buffer memory.\n");
......
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