Skip to content

Commit

Permalink
Fix return value for WebP errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Talinx committed Sep 8, 2024
1 parent 130da62 commit 6d57a20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/jp2a.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ int main(int argc, char** argv) {

errors.jpeg_status = 0;
errors.png_status = 0;
errors.webp_status = 0;

// read from stdin
if ( argv[n][0]=='-' && !argv[n][1] ) {
Expand Down Expand Up @@ -110,7 +111,7 @@ int main(int argc, char** argv) {
#endif
}

if ( errors.jpeg_status && errors.png_status )
if ( errors.jpeg_status && errors.png_status && errors.webp_status )
retval = 1;
continue;
}
Expand Down Expand Up @@ -155,7 +156,7 @@ int main(int argc, char** argv) {
fclose(fr);
close(fd);

if ( errors.jpeg_status && errors.png_status )
if ( errors.jpeg_status && errors.png_status && errors.webp_status )
retval = 1;
continue;
}
Expand All @@ -175,7 +176,7 @@ int main(int argc, char** argv) {
decompress_jpeg(fp, fout, &errors);
fclose(fp);

if ( errors.jpeg_status && errors.png_status )
if ( errors.jpeg_status && errors.png_status && errors.webp_status )
retval = 1;
continue;

Expand Down

0 comments on commit 6d57a20

Please sign in to comment.