pcsx2|gsdx: avoid potential null deferencement

This commit is contained in:
Gregory Hainaut 2015-09-10 14:42:54 +02:00
parent 0260c9119e
commit ac8f4e69d6
2 changed files with 7 additions and 1 deletions

View File

@ -303,6 +303,11 @@ local int build_index(FILE *in, PX_off_t span, struct access **built)
}
} while (ret != Z_STREAM_END);
if (index == NULL) {
// Could happen if the start of the stream in Z_STREAM_END
return 0;
}
/* clean up and return index (release unused entries in list) */
(void)inflateEnd(&strm);
index->list = (Point*)realloc(index->list, sizeof(struct point) * index->have);

View File

@ -463,6 +463,7 @@ void GSRendererHW::Draw()
{
s = format("%05d_f%lld_rz0_%05x_%d.bmp", s_n, frame, context->ZBUF.Block(), context->ZBUF.PSM);
if (ds_tex)
ds_tex->Save(root_hw+s);
}