Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-05-17 03:50:21 +0300
committerCampbell Barton <campbell@blender.org>2022-05-17 03:50:21 +0300
commit77ddcc471721194531834786c010b9e603cb18d8 (patch)
tree32c02fe7223c3979072040383d608a8a4b4988e5 /source/blender/imbuf
parent7bbf1010825106629b1619852d463b5949d0f160 (diff)
ImBuf: replace exit(1) with assert when writing IRIS images
In this case memory past the buffer bounds would have been written, potentially crashing. Replace the check with an assert since this should never happen. Also don't call exit as failing to write a file shouldn't exit Blender.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/iris.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index c3d940d85be..a8150fd1648 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -854,10 +854,9 @@ static bool output_iris(const char *filepath,
len = compressrow((const uchar *)zptr, rlebuf, CHANOFFSET(z - 4), xsize);
}
}
- if (len > rlebuflen) {
- fprintf(stderr, "output_iris: rlebuf is too small - bad poop\n");
- exit(1);
- }
+
+ BLI_assert_msg(len <= rlebuflen, "The length calculated for 'rlebuflen' was too small!");
+
goodwrite *= fwrite(rlebuf, len, 1, outf);
starttab[y + z * ysize] = pos;
lengthtab[y + z * ysize] = len;