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. 5
      src/vrend_renderer.c

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

Loading…
Cancel
Save