[Bf-blender-cvs] [226eb53] master: Fix T41883 proxy sizes not correct.

Antony Riakiotakis noreply at git.blender.org
Thu Dec 4 16:38:13 CET 2014


Commit: 226eb53bc7f6d0aa1769b6c889d3b15d1f4944b5
Author: Antony Riakiotakis
Date:   Thu Dec 4 16:37:09 2014 +0100
Branches: master
https://developer.blender.org/rB226eb53bc7f6d0aa1769b6c889d3b15d1f4944b5

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.

===================================================================

M	source/blender/blenkernel/intern/sequencer.c

===================================================================

diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 999c8fb..86a2b1d 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... */




More information about the Bf-blender-cvs mailing list