X-Git-Url: https://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/67c2273969a556d9f54e027e5a520280fcc86d54..cf8a7156857f04c8fc506303ff8925b737dde62d:/src/image.c?ds=sidebyside diff --git a/src/image.c b/src/image.c index 15c7255..6c77ed3 100644 --- a/src/image.c +++ b/src/image.c @@ -71,12 +71,6 @@ struct lbx_image *lbximg_fopen(FILE *f) tmp.leadin = letohs(tmp.leadin); tmp.foff += sizeof tmp.leadin; tmp.flags = letohs(tmp.flags); tmp.foff += sizeof tmp.flags; - /* Format constraints. */ - if (tmp.frames <= tmp.leadin) { - lbx_errno = LBX_EFORMAT; - return NULL; - } - /* * DEBUG ONLY. These assertions exist to catch otherwise valid image * files which differ from what I believe to be true of all LBX images. @@ -84,6 +78,7 @@ struct lbx_image *lbximg_fopen(FILE *f) * assumptions. */ _lbx_assert(tmp.wtf1 == 0); + _lbx_assert(tmp.frames > tmp.leadin); /* cmbtshp.lbx breaks this. */ _lbx_assert(!(tmp.flags & ~(FLAG_PALETTE|FLAG_OVERWRITE|FLAG_LOOPING))); new = malloc(sizeof *new + (tmp.frames+1) * sizeof *new->offsets);