+ /* Read frame header */
+ if (img->fops->read(buf, 4, img->f) != 4) {
+ if (img->fops->eof(img->f))
+ lbx_error_raise(LBX_EEOF);
+ return NULL;
+ }
+
+ if (unpack_16_le(buf) != 1) {
+ lbx_error_raise(LBX_EFORMAT);
+ return NULL;
+ }
+
+ img->currentx = 0;
+ img->currenty = unpack_16_le(buf+2);
+ if (img->currenty > img->pub.height) {
+ lbx_error_raise(LBX_EFORMAT);
+ return NULL;
+ }
+