diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-04-30 13:10:58 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-04-30 13:11:20 +0300 |
commit | 290997538590d54387602a37879ad4cffbc311da (patch) | |
tree | 58887bf967bd42e36b9609006304d9683461d6ac /source/blender/imbuf/intern/imageprocess.c | |
parent | 4bcc7a2ec6bf6937778a2227c7f938c50a0fafe5 (diff) |
Fix T44541 aka gigapixel image render support in blender.
Moral of the story: Make sure that size_t is used whenever pointer
arithmetic is involved. For images, that basically means whenever any
squared dimensions are involved. Casting an operand to size_t early in
the operation is usually sufficient to force the entire operation to
size_t.
There might still be places lurking where we don't support this
correctly. This has been tested with render pipeline, quite a few image
functions (meaning we can paint on such images now, albeit somewhat
slowly ;) ) and export to jpeg. Too many places in code to check so I
guess we'll be handling cases as they come.
Don't try this at home unless you have an immense ammount of RAM.
First GPixel render of suzanne in the multiverse can be found here:
http://download.blender.org/demo/test/suzanne-billion-pixel.jpg
Can be viewed from blender (takes about 3.3 GB after loading but may
take more during loading so 8GB might be more safe to try this).
Diffstat (limited to 'source/blender/imbuf/intern/imageprocess.c')
-rw-r--r-- | source/blender/imbuf/intern/imageprocess.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 8234b01992b..90219461772 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -343,7 +343,7 @@ void IMB_processor_apply_threaded(int buffer_lines, int handle_size, void *init_ void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[3]) { - int a = x * y; + size_t a = ((size_t)x) * y; float *fp = rect_float; while (a--) { @@ -366,7 +366,7 @@ void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[ void IMB_alpha_under_color_byte(unsigned char *rect, int x, int y, float backcol[3]) { - int a = x * y; + size_t a = ((size_t)x) * y; unsigned char *cp = rect; while (a--) { |