ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Crash when passing NULL to glBufferData #438

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Include a line like glBufferData(GL_ARRAY_BUFFER, 100000, 0, GL_STATIC_DRAW) 
in a GL program where a buffer name has been properly gen'ed and bound to the 
GL_ARRAY_BUFFER target.

or

read the source code for BufferStorage{9,11}::setData and observe the memcpy 
and other operations attempted with data even when data == NULL.

What is the expected output? What do you see instead?
I expect the program to run. Instead it crashes. The OpenGL ES 2.0 spec. on 
page p23 (reader p33) under BufferData says "If /data/ is null then the 
contents of the buffer object's data are undefined."

What version of the product are you using? On what operating system?
New master and old dx9-only branch both have the problem and in master it is a 
problem for both dx9 and dx11 renderers.

Original issue reported on code.google.com by callow.m...@artspark.co.jp on 19 Jun 2013 at 10:01

GoogleCodeExporter commented 9 years ago
This issue is not showing up when I do an empty search of open issues nor when 
I search for words in the issue subject. I only see it if I enter the bug 
number.

Original comment by callow.m...@artspark.co.jp on 19 Jun 2013 at 10:21

GoogleCodeExporter commented 9 years ago
Here' a patch. Not up on Git yet.

Original comment by callow.m...@artspark.co.jp on 19 Jun 2013 at 10:28

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by shannonw...@google.com on 19 Jun 2013 at 4:30

GoogleCodeExporter commented 9 years ago

Original comment by shannonw...@chromium.org on 24 Jun 2013 at 5:52

GoogleCodeExporter commented 9 years ago
We're hitting this while upgrading Firefox's ANGLE, but for now, we'll just 
calloc a fake buffer of zeros.

Original comment by jda...@gmail.com on 25 Jun 2013 at 11:16

GoogleCodeExporter commented 9 years ago
> We're hitting this while upgrading Firefox's ANGLE, but for now,
> we'll just calloc a fake buffer of zeros.

You have to do that anyway because the WebGL spec calls for the buffer to be 
initialized to zero when the WebGL's size function is called. The GL does not 
do that. It merely allocates the buffer storage.

Original comment by callow.m...@artspark.co.jp on 26 Jun 2013 at 1:50

GoogleCodeExporter commented 9 years ago
This fix has been pushed at commit id 45494d463d72 in the master branch.

Original comment by shannonw...@chromium.org on 26 Jun 2013 at 11:19