- image->offset = 0;
- if (buf_copy(src, image, 8) || buf_getbyte(src, 0) != 0x2c) goto failed;
- if (gif_extract_image(src, image)) goto failed;
- if (get_first_image) goto write;
+ if (image_buffered == 1)
+ {
+ image->offset = 0;
+ image_buffered = 0;
+ }
+ if (buf_copy(src, image, 8)) goto failed;