diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-12-04 18:37:09 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-12-04 18:37:56 +0300 |
commit | 226eb53bc7f6d0aa1769b6c889d3b15d1f4944b5 (patch) | |
tree | 17b4d2bd698d8e8b287195f4e7115a44166b7373 /source/blender/blenkernel/intern | |
parent | c57d9c05d666e65b764290684dd39ea44a64cf25 (diff) |
Fix T41883 proxy sizes not correct.
Really bad issue which meant code could fetch an image buffer from the
stored cache and modify it. Generally sequence image buffers could come
from the cache and should not be modified directly. Easily solved by
scaling a copy of the original.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 999c8fba80f..86a2b1d8b61 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1489,20 +1489,25 @@ static void seq_proxy_build_frame(const SeqRenderData *context, Sequence *seq, i int quality; int rectx, recty; int ok; - ImBuf *ibuf; + ImBuf *ibuf_tmp, *ibuf; if (!seq_proxy_get_fname(seq, cfra, proxy_render_size, name)) { return; } - ibuf = seq_render_strip(context, seq, cfra); + ibuf_tmp = seq_render_strip(context, seq, cfra); - rectx = (proxy_render_size * ibuf->x) / 100; - recty = (proxy_render_size * ibuf->y) / 100; + rectx = (proxy_render_size * ibuf_tmp->x) / 100; + recty = (proxy_render_size * ibuf_tmp->y) / 100; - if (ibuf->x != rectx || ibuf->y != recty) { + if (ibuf_tmp->x != rectx || ibuf_tmp->y != recty) { + ibuf = IMB_dupImBuf(ibuf_tmp); + IMB_freeImBuf(ibuf_tmp); IMB_scalefastImBuf(ibuf, (short)rectx, (short)recty); } + else { + ibuf = ibuf_tmp; + } /* depth = 32 is intentionally left in, otherwise ALPHA channels * won't work... */ |