Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
2a353a75
Commit
2a353a75
authored
Aug 06, 2013
by
Geoff Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split the overflow check into explicit multiplication and addition overflow checks.
TRAC #23671 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang
parent
662c3afa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
version.h
src/common/version.h
+1
-1
IndexDataManager.cpp
src/libGLESv2/renderer/IndexDataManager.cpp
+3
-3
No files found.
src/common/version.h
View file @
2a353a75
#define MAJOR_VERSION 1
#define MAJOR_VERSION 1
#define MINOR_VERSION 2
#define MINOR_VERSION 2
#define BUILD_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 243
3
#define BUILD_REVISION 243
4
#define STRINGIFY(x) #x
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/libGLESv2/renderer/IndexDataManager.cpp
View file @
2a353a75
...
@@ -140,9 +140,9 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, gl::Buffer
...
@@ -140,9 +140,9 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, gl::Buffer
unsigned
int
typeSize
=
gl
::
ComputeTypeSize
(
type
);
unsigned
int
typeSize
=
gl
::
ComputeTypeSize
(
type
);
// check for integer overflows
and underflows
// check for integer overflows
if
(
static_cast
<
unsigned
int
>
(
offse
t
)
>
(
std
::
numeric_limits
<
unsigned
int
>::
max
()
/
typeSize
)
||
if
(
static_cast
<
unsigned
int
>
(
coun
t
)
>
(
std
::
numeric_limits
<
unsigned
int
>::
max
()
/
typeSize
)
||
static_cast
<
unsigned
int
>
(
count
)
>
((
std
::
numeric_limits
<
unsigned
int
>::
max
()
/
typeSize
)
-
offset
)
)
typeSize
*
static_cast
<
unsigned
int
>
(
count
)
+
offset
<
offset
)
{
{
return
GL_OUT_OF_MEMORY
;
return
GL_OUT_OF_MEMORY
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment