Commit e0e423aa authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Dave Airlie

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: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent 9033b269
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment