]> git.draconx.ca Git - liblbx.git/commitdiff
"Downgrade" the nframes > leadin constraint to a format assertion.
authorNick Bowler <draconx@gmail.com>
Fri, 4 Jan 2008 19:53:52 +0000 (14:53 -0500)
committerNick Bowler <draconx@gmail.com>
Fri, 4 Jan 2008 19:53:52 +0000 (14:53 -0500)
The cmbtshp.lbx images have huge values for leadin, which makes me question
my interpretation of the value.

src/image.c

index 15c725561d2b9c320bcaee2e95c8ca4dbf85e32e..6c77ed3d3a335ac89e92462922b978165409c496 100644 (file)
@@ -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);