You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We get the number of attached shaders with shadersLen := GetProgrami(p, ATTACHED_SHADERS) and allocate the buffer based on that number, but we never check if it's zero.
Simplest fix would be something like this:
func GetAttachedShaders(p Program) []Shader {
shadersLen := GetProgrami(p, ATTACHED_SHADERS)
+ if shadersLen == 0 {+ return []Shader{}+ }
var n C.GLsizei
buf := make([]C.GLuint, shadersLen)
...
This is on go version devel +71832ff Fri Jul 3 21:39:04 2015 +0000 darwin/amd64 with the latest x/mobile (9865dd0).
(Happy to do a CL if that would be more convenient.)
The text was updated successfully, but these errors were encountered:
When calling
gl.GetAttachedShaders(program)
on a program that has no shaders attached, an avoidable panic occurs.We get the number of attached shaders with
shadersLen := GetProgrami(p, ATTACHED_SHADERS)
and allocate the buffer based on that number, but we never check if it's zero.Simplest fix would be something like this:
This is on
go version devel +71832ff Fri Jul 3 21:39:04 2015 +0000 darwin/amd64
with the latest x/mobile (9865dd0).(Happy to do a CL if that would be more convenient.)
The text was updated successfully, but these errors were encountered: