renderer: avoid crash in vrend_destroy_shader_selector()

If we didn't run succesfully vrend_destroy_shader_selector(),
sel->sinfo.so_names might be NULL.

Fix found thanks to american fuzzy lop.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 9033b26976
commit e0e423aacd
  1. 1
      src/vrend_renderer.c

@ -560,6 +560,7 @@ static void vrend_destroy_shader_selector(struct vrend_shader_selector *sel)
vrend_shader_destroy(p); vrend_shader_destroy(p);
p = c; p = c;
} }
if (sel->sinfo.so_names)
for (i = 0; i < sel->sinfo.so_info.num_outputs; i++) for (i = 0; i < sel->sinfo.so_info.num_outputs; i++)
free(sel->sinfo.so_names[i]); free(sel->sinfo.so_names[i]);
free(sel->tmp_buf); free(sel->tmp_buf);

Loading…
Cancel
Save