(ImgdFormat): check base.ReadMetaData return value.

This commit is contained in:
morkt 2016-03-14 05:58:24 +04:00
parent 5965c62f9b
commit f1a39a1eee

View File

@ -161,6 +161,8 @@ namespace GameRes.Formats.Hexenhaus
ImageMetaData info; ImageMetaData info;
using (var png = new StreamRegion (stream, 0x10, true)) using (var png = new StreamRegion (stream, 0x10, true))
info = base.ReadMetaData (png); info = base.ReadMetaData (png);
if (null == info)
return null;
stream.Seek (-14, SeekOrigin.End); stream.Seek (-14, SeekOrigin.End);
var cntr = new byte[12]; var cntr = new byte[12];
stream.Read (cntr, 0, 12); stream.Read (cntr, 0, 12);