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
0b78533f
Commit
0b78533f
authored
Jul 31, 2013
by
Geoff Lang
Committed by
Geoff Lang
Aug 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix additional overflow and underflow issues with line loops.
Issue #444 Signed-off-by: Shannon Woods Signed-off-by: Chris Evans Author: Geoff Lang
parent
74fe3199
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
version.h
src/common/version.h
+1
-1
Context.cpp
src/libGLESv2/Context.cpp
+10
-4
No files found.
src/common/version.h
View file @
0b78533f
#define MAJOR_VERSION 1
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 225
4
#define BUILD_REVISION 225
5
#define STRINGIFY(x) #x
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/libGLESv2/Context.cpp
View file @
0b78533f
...
@@ -3253,11 +3253,14 @@ void Context::drawLineLoop(GLsizei count, GLenum type, const GLvoid *indices, in
...
@@ -3253,11 +3253,14 @@ void Context::drawLineLoop(GLsizei count, GLenum type, const GLvoid *indices, in
if
(
supports32bitIndices
())
if
(
supports32bitIndices
())
{
{
if
(
static_cast
<
unsigned
int
>
(
count
+
1
)
>
(
std
::
numeric_limits
<
unsigned
int
>::
max
()
/
sizeof
(
unsigned
int
)))
// Verified by the glDraw* functions
ASSERT
(
count
>=
0
);
if
(
static_cast
<
unsigned
int
>
(
count
)
+
1
>
(
std
::
numeric_limits
<
unsigned
int
>::
max
()
/
sizeof
(
unsigned
int
)))
{
{
return
error
(
GL_OUT_OF_MEMORY
);
return
error
(
GL_OUT_OF_MEMORY
);
}
}
const
unsigned
int
spaceNeeded
=
(
count
+
1
)
*
sizeof
(
unsigned
int
);
const
unsigned
int
spaceNeeded
=
(
static_cast
<
unsigned
int
>
(
count
)
+
1
)
*
sizeof
(
unsigned
int
);
if
(
!
mLineLoopIB
)
if
(
!
mLineLoopIB
)
{
{
...
@@ -3314,11 +3317,14 @@ void Context::drawLineLoop(GLsizei count, GLenum type, const GLvoid *indices, in
...
@@ -3314,11 +3317,14 @@ void Context::drawLineLoop(GLsizei count, GLenum type, const GLvoid *indices, in
}
}
else
else
{
{
if
(
static_cast
<
unsigned
short
>
(
count
+
1
)
>
(
std
::
numeric_limits
<
unsigned
short
>::
max
()
/
sizeof
(
unsigned
short
)))
// Verified by the glDraw* functions
ASSERT
(
count
>=
0
);
if
(
static_cast
<
unsigned
short
>
(
count
)
+
1
>
(
std
::
numeric_limits
<
unsigned
short
>::
max
()
/
sizeof
(
unsigned
short
)))
{
{
return
error
(
GL_OUT_OF_MEMORY
);
return
error
(
GL_OUT_OF_MEMORY
);
}
}
const
unsigned
int
spaceNeeded
=
(
count
+
1
)
*
sizeof
(
unsigned
short
);
const
unsigned
int
spaceNeeded
=
(
static_cast
<
unsigned
short
>
(
count
)
+
1
)
*
sizeof
(
unsigned
short
);
if
(
!
mLineLoopIB
)
if
(
!
mLineLoopIB
)
{
{
...
...
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