Commit 5ba1f867 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

d3dxof: Check returns of read_bytes (Coverity).

parent c2748cfb
......@@ -233,8 +233,10 @@ HRESULT parse_header(parse_buffer * buf, BYTE ** decomp_buffer_ptr)
buf->rem_bytes -= sizeof(WORD) * 2;
buf->buffer += sizeof(WORD) * 2;
read_bytes(buf, &decomp_size, sizeof(decomp_size));
read_bytes(buf, &comp_size, sizeof(comp_size));
if (!read_bytes(buf, &decomp_size, sizeof(decomp_size)))
return DXFILEERR_BADFILETYPE;
if (!read_bytes(buf, &comp_size, sizeof(comp_size)))
return DXFILEERR_BADFILETYPE;
TRACE("Compressed format %s detected: compressed_size = %x, decompressed_size = %x\n",
debugstr_fourcc(header[2]), comp_size, decomp_size);
......@@ -1049,7 +1051,8 @@ static void go_to_next_definition(parse_buffer * buf)
char c;
while (buf->rem_bytes)
{
read_bytes(buf, &c, 1);
if (!read_bytes(buf, &c, 1))
return;
if ((c == '#') || (c == '/'))
{
/* Handle comment (# or //) */
......
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