diff options
author | Vincent Sanders <vince@kyllikki.org> | 2016-08-12 15:29:04 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2016-08-12 15:29:04 +0100 |
commit | 091d1a1f15aab463054f637d6830808bbe893af8 (patch) | |
tree | 8908159321edcc5e9644f8dd6945acb851093a0b /test/decode_bmp.c | |
parent | b017792feaa0c28ef22d0d60e11612846e8e1db5 (diff) | |
download | libnsbmp-091d1a1f15aab463054f637d6830808bbe893af8.tar.gz libnsbmp-091d1a1f15aab463054f637d6830808bbe893af8.tar.bz2 |
Improve test runner and prevent generation of excessively large output
Diffstat (limited to 'test/decode_bmp.c')
-rw-r--r-- | test/decode_bmp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/decode_bmp.c b/test/decode_bmp.c index e5dc572..e90515a 100644 --- a/test/decode_bmp.c +++ b/test/decode_bmp.c @@ -70,6 +70,11 @@ int main(int argc, char *argv[]) res = 1; goto cleanup; } + /* skip if the decoded image would be ridiculously large */ + if ((bmp.width * bmp.height) > 2000000) { + res = 1; + goto cleanup; + } } printf("P3\n"); |