Skip to content

Commit

Permalink
FLIF 0.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsneyers committed Sep 22, 2016
1 parent eb4c294 commit 024b039
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/flif-dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,10 +1001,10 @@ bool flif_decode(IO& io, Images &images, int quality, int scale, uint32_t (*call

int scale_shift = ilog2(scale);
if (scale_shift>0) v_printf(3,"Decoding downscaled image at scale 1:%i (%ix%i -> %ix%i)\n", scale, width, height, ((width-1)/scale)+1, ((height-1)/scale)+1);
int bytesperpixel = (maxmax > 255 ? 2 : 1) * (numPlanes + (numPlanes > 1 ? 2 : 0));
uint64_t estimated_buffer_size = (((width-1)/scale)+1) * (((height-1)/scale)+1) * numFrames * numPlanes * bytesperpixel;
uint64_t bytesperpixel = (maxmax > 255 ? 2 : 1) * (numPlanes + (numPlanes > 1 ? 2 : 0));
uint64_t estimated_buffer_size = (uint64_t)(((width-1)/scale)+1) * (uint64_t)(((height-1)/scale)+1) * (uint64_t)numFrames * (uint64_t)numPlanes * bytesperpixel;
if (estimated_buffer_size > MAX_IMAGE_BUFFER_SIZE) {
e_printf("This is going to take too much memory. Aborting.\nCompile with a higher MAX_IMAGE_BUFFER_SIZE if you really want to do this.\n"); return false;
e_printf("This is going to take too much memory (%llu > %llu). Aborting.\nCompile with a higher MAX_IMAGE_BUFFER_SIZE if you really want to do this.\n",estimated_buffer_size, MAX_IMAGE_BUFFER_SIZE); return false;
}

for (int i=0; i<numFrames; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/flif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool file_is_flif(const char * filename){

void show_banner() {
v_printf(3," ____ _(_)____\n");
v_printf(3," (___ | | | ___) ");v_printf(2,"FLIF (Free Lossless Image Format) 0.2.0rc19 [26 Aug 2016]\n");
v_printf(3," (___ | | | ___) ");v_printf(2,"FLIF (Free Lossless Image Format) 0.2.0 [22 Sept 2016]\n");
v_printf(3," (__ | |_| __) ");v_printf(3,"Copyright (C) 2016 Jon Sneyers and Pieter Wuille\n");
v_printf(3," (_|___|_) ");
#ifdef HAS_ENCODER
Expand Down

0 comments on commit 024b039

Please sign in to comment.