r300g: return NULL texture early if buffer_create fails

This commit is contained in:
Marek Olšák 2010-06-09 20:16:00 +02:00
parent da4185ca77
commit 950be3fa3c

View file

@ -979,16 +979,16 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
tex->buffer = rws->buffer_create(rws, 2048, base->bind, tex->domain,
tex->size);
if (!tex->buffer) {
FREE(tex);
return NULL;
}
rws->buffer_set_tiling(rws, tex->buffer,
tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
tex->microtile,
tex->macrotile);
if (!tex->buffer) {
FREE(tex);
return NULL;
}
return (struct pipe_resource*)tex;
}