]> granicus.if.org Git - graphviz/commit
fix handling of glGenTextures failure
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Sep 2020 00:26:51 +0000 (17:26 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Sep 2020 02:27:04 +0000 (19:27 -0700)
commitad8ef3ec109a6c2aa086775a1fccd7d913055b8a
tree57835f49018ce0b4bdf4646af7981738bfd25d7f
parent4bf9eb7115940cbb903f317492ee2c815121b525
fix handling of glGenTextures failure

According to the OpenGL docs, glGenTextures indicates failure not through
returning a value in its out parameter but rather via the glGetError API.
Moreover it could not actually indicate failure in the way this call site was
expecting because the out parameter is unsigned, not signed. This issue was
identified while investigating the cause of the following compiler warning:

  glcomptexture.c: In function â€˜glCompSetAddNewTexture’:
  glcomptexture.c:45:12: warning: comparison of unsigned expression < 0 is
    always false [-Wtype-limits]

    if (t->id < 0)  /*for some opengl based error , texture couldnt be created */
              ^
CHANGELOG.md
lib/glcomp/glcomptexture.c