[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51158] trunk/blender/source/blender/ blenkernel/intern/sequencer.c: fix for crash in the sequencer if the video file fails to load ( missing NULL check on imbuf),

Campbell Barton ideasman42 at gmail.com
Mon Oct 8 04:20:51 CEST 2012


Revision: 51158
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51158
Author:   campbellbarton
Date:     2012-10-08 02:20:47 +0000 (Mon, 08 Oct 2012)
Log Message:
-----------
fix for crash in the sequencer if the video file fails to load (missing NULL check on imbuf),

all other uses of sequencer_imbuf_assign_spaces() check for NULL or assume IMB_allocImBuf() succeeds.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sequencer.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2012-10-08 01:25:21 UTC (rev 51157)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2012-10-08 02:20:47 UTC (rev 51158)
@@ -1965,13 +1965,16 @@
 
 static void copy_to_ibuf_still(SeqRenderData context, Sequence *seq, float nr, ImBuf *ibuf)
 {
+	/* warning: ibuf may be NULL if the video fails to load */
 	if (nr == 0 || nr == seq->len - 1) {
 		/* we have to store a copy, since the passed ibuf
 		 * could be preprocessed afterwards (thereby silently
 		 * changing the cached image... */
 		ibuf = IMB_dupImBuf(ibuf);
 
-		sequencer_imbuf_assign_spaces(context.scene, ibuf);
+		if (ibuf) {
+			sequencer_imbuf_assign_spaces(context.scene, ibuf);
+		}
 
 		if (nr == 0) {
 			BKE_sequencer_cache_put(context, seq, seq->start, SEQ_STRIPELEM_IBUF_STARTSTILL, ibuf);




More information about the Bf-blender-cvs mailing list