summaryrefslogtreecommitdiff
path: root/src/bin/jp2/convertbmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/jp2/convertbmp.c')
-rw-r--r--src/bin/jp2/convertbmp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c
index 78ca4af5..910574b8 100644
--- a/src/bin/jp2/convertbmp.c
+++ b/src/bin/jp2/convertbmp.c
@@ -903,6 +903,10 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
<<-- <<-- <<-- <<-- */
fdest = fopen(outfile, "wb");
+ if (!fdest) {
+ fprintf(stderr, "ERROR -> failed to open %s for writing\n", outfile);
+ return 1;
+ }
w = (int)image->comps[0].w;
h = (int)image->comps[0].h;