diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-22 05:08:40 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-22 05:08:40 +0000 |
commit | 4999a70a926d10c2789d8cae430a43f17bc287fa (patch) | |
tree | 8982bae7d7118b8b3328394a4bbd423b764b5bf5 /webkit/gpu | |
parent | a7906507449fade6623f6558e28dc36155acb072 (diff) | |
download | chromium_src-4999a70a926d10c2789d8cae430a43f17bc287fa.zip chromium_src-4999a70a926d10c2789d8cae430a43f17bc287fa.tar.gz chromium_src-4999a70a926d10c2789d8cae430a43f17bc287fa.tar.bz2 |
Coverity: Handle a NULL input in WebGraphicsContext3DInProcessImpl::shaderSource.
BUG=none
TEST=none
CID=14435
Review URL: http://codereview.chromium.org/7218032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/gpu')
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_impl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index f01543a..300bd27 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -1370,7 +1370,10 @@ void WebGraphicsContext3DInProcessImpl::shaderSource( ShaderSourceEntry* entry = result->second; DCHECK(entry); entry->source.reset(new char[length + 1]); - memcpy(entry->source.get(), source, (length + 1) * sizeof(char)); + if (source) + memcpy(entry->source.get(), source, (length + 1) * sizeof(char)); + else + entry->source[0] = '\0'; } else { glShaderSource(shader, 1, &source, &length); } |