Add NULL checks and assertions to fix clang static analysis problems

Also remove an unused variable from obs-encoder.c (via clang static
analysis)
This commit is contained in:
Palana
2014-04-14 22:55:14 +02:00
parent e378ec8e4f
commit 3990c18aac
9 changed files with 25 additions and 8 deletions

View File

@@ -809,13 +809,16 @@ void gs_draw_cube_backdrop(texture_t cubetex, const struct quat *rot,
void gs_resetviewport(void)
{
uint32_t cx, cy;
assert(thread_graphics != NULL);
gs_getsize(&cx, &cy);
gs_setviewport(0, 0, (int)cx, (int)cy);
}
void gs_set2dmode(void)
{
uint32_t cx, cy;
assert(thread_graphics != NULL);
gs_getsize(&cx, &cy);
gs_ortho(0.0f, (float)cx, 0.0f, (float)cy, -1.0, -1024.0f);