Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLTexture.cpp

Issue 1468883002: Fix the crash of compressedTexImage3D for the WebGL2 conformance test page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 { 166 {
167 ASSERT(!m_immutable); 167 ASSERT(!m_immutable);
168 168
169 if (!object() || !m_target) 169 if (!object() || !m_target)
170 return; 170 return;
171 // We assume level, internalFormat, width, height, depth, and type have all been 171 // We assume level, internalFormat, width, height, depth, and type have all been
172 // validated already. 172 // validated already.
173 int index = mapTargetToIndex(target); 173 int index = mapTargetToIndex(target);
174 if (index < 0) 174 if (index < 0)
175 return; 175 return;
176
177 if (level < 0 || level >= static_cast<GLint>(m_info[index].size()))
178 return;
qiankun 2015/11/23 06:19:00 See the above comments. level should be validated
179
176 m_info[index][level].setInfo(internalFormat, width, height, depth, type); 180 m_info[index][level].setInfo(internalFormat, width, height, depth, type);
177 update(); 181 update();
178 } 182 }
179 183
180 void WebGLTexture::setTexStorageInfo(GLenum target, GLint levels, GLenum interna lFormat, GLsizei width, GLsizei height, GLsizei depth) 184 void WebGLTexture::setTexStorageInfo(GLenum target, GLint levels, GLenum interna lFormat, GLsizei width, GLsizei height, GLsizei depth)
181 { 185 {
182 ASSERT(!m_immutable); 186 ASSERT(!m_immutable);
183 187
184 // We assume level, internalFormat, width, height, and depth have all been 188 // We assume level, internalFormat, width, height, and depth have all been
185 // validated already. 189 // validated already.
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: 598 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
595 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: 599 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
596 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: 600 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
597 return GL_UNSIGNED_BYTE; 601 return GL_UNSIGNED_BYTE;
598 default: 602 default:
599 return GL_NONE; 603 return GL_NONE;
600 } 604 }
601 } 605 }
602 606
603 } // namespace blink 607 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698