From 226eb53bc7f6d0aa1769b6c889d3b15d1f4944b5 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 4 Dec 2014 16:37:09 +0100 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/sequencer.c | 15 ++++++++++----- 1 file 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... */