mirror of https://github.com/PCSX2/pcsx2.git
pcsx2|gsdx: avoid potential null deferencement
This commit is contained in:
parent
0260c9119e
commit
ac8f4e69d6
|
@ -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);
|
||||
|
|
|
@ -463,7 +463,8 @@ void GSRendererHW::Draw()
|
|||
{
|
||||
s = format("%05d_f%lld_rz0_%05x_%d.bmp", s_n, frame, context->ZBUF.Block(), context->ZBUF.PSM);
|
||||
|
||||
ds_tex->Save(root_hw+s);
|
||||
if (ds_tex)
|
||||
ds_tex->Save(root_hw+s);
|
||||
}
|
||||
|
||||
s_n++;
|
||||
|
|
Loading…
Reference in New Issue