Rico Schüller : d3d10: Add data and size check to parse_dxbc().
Module: wine Branch: master Commit: 51c2542631688c0de24cdcf44e7da9963b7cfb2c URL: http://source.winehq.org/git/wine.git/?a=commit;h=51c2542631688c0de24cdcf44e... Author: Rico Schüller <kgbricola(a)web.de> Date: Mon Jul 19 21:48:41 2010 +0200 d3d10: Add data and size check to parse_dxbc(). --- dlls/d3d10/utils.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/dlls/d3d10/utils.c b/dlls/d3d10/utils.c index 633d411..a3f761e 100644 --- a/dlls/d3d10/utils.c +++ b/dlls/d3d10/utils.c @@ -141,6 +141,12 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size, unsigned int i; DWORD tag; + if (!data) + { + WARN("No data supplied.\n"); + return E_FAIL; + } + read_dword(&ptr, &tag); TRACE("tag: %s.\n", debugstr_an((const char *)&tag, 4)); @@ -158,6 +164,12 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size, read_dword(&ptr, &total_size); TRACE("total size: %#x\n", total_size); + if (data_size != total_size) + { + WARN("Wrong size supplied.\n"); + return E_FAIL; + } + read_dword(&ptr, &chunk_count); TRACE("chunk count: %#x\n", chunk_count);
participants (1)
-
Alexandre Julliard