Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused error variable #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions lodepng.cpp
Expand Up @@ -5224,7 +5224,6 @@ static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w,
size_t bytewidth = (bpp + 7) / 8;
const unsigned char* prevline = 0;
unsigned x, y;
unsigned error = 0;
LodePNGFilterStrategy strategy = settings->filter_strategy;

/*
Expand Down Expand Up @@ -5270,8 +5269,6 @@ static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w,
if(!attempt[type]) return 83; /*alloc fail*/
}

if(!error)
{
for(y = 0; y != h; ++y)
{
/*try the 5 filter types*/
Expand Down Expand Up @@ -5311,7 +5308,6 @@ static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w,
out[y * (linebytes + 1)] = bestType; /*the first byte of a scanline will be the filter type*/
for(x = 0; x != linebytes; ++x) out[y * (linebytes + 1) + 1 + x] = attempt[bestType][x];
}
}

for(type = 0; type != 5; ++type) lodepng_free(attempt[type]);
}
Expand Down Expand Up @@ -5425,7 +5421,7 @@ static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w,
}
else return 88; /* unknown filter strategy */

return error;
return 0;
}

static void addPaddingBits(unsigned char* out, const unsigned char* in,
Expand Down