Skip to content

Commit 76f25e5

Browse files
committed
gpujpegtool: check nr of iterations
the value is not checked (just atoi()) so check the value if it was not ued in a wrong way (eg. without a value, misused for another option)
1 parent 9c6b75a commit 76f25e5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,11 @@ main(int argc, char *argv[])
657657
return 0;
658658
}
659659

660+
if (iterate <= 0) {
661+
fprintf(stderr, "Number of iterations must be greater than zero, got: %d\n", iterate);
662+
return -1;
663+
}
664+
660665
// Source image and target image must be presented
661666
if ( argc < 2 || argc % 2 != 0 ) {
662667
fprintf(stderr, "Please supply source and destination image filename(s)!\n");

0 commit comments

Comments
 (0)