Commit: e23bcbbb6d78709993b6187a2631eb20cd555e5a
Author: Lukas Tönne
Date: Tue Jan 7 14:51:59 2014 +0100
https://developer.blender.org/rBe23bcbbb6d78709993b6187a2631eb20cd555e5a
Fix for crash in anim render: The callbacks in bMovieHandle are expected
to exist and accessed without prior NULL checks (with exception of
get_next_frame and get_movie_path). The callbacks are not reliably
initialized however if none of the video formats is enabled (AVI being
the default). Added stub functions now that ensure access to
bMovieHandle callbacks is safe and doesn't crash.
===================================================================
M source/blender/blenkernel/intern/writeavi.c
===================================================================
diff --git a/source/blender/blenkernel/intern/writeavi.c
b/source/blender/blenkernel/intern/writeavi.c
index 1d29ef7..40bb593 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -50,6 +50,17 @@
/* ********************** general blender movie support
***************************** */
+static int start_stub(Scene *UNUSED(scene), RenderData *UNUSED(rd), int
UNUSED(rectx), int UNUSED(recty),
+ ReportList *UNUSED(reports))
+{ return 0; }
+
+static void end_stub(void)
+{}
+
+static int append_stub(RenderData *UNUSED(rd), int UNUSED(start_frame), int
UNUSED(frame), int *UNUSED(pixels),
+ int UNUSED(rectx), int UNUSED(recty), ReportList
*UNUSED(reports))
+{ return 0; }
+
#ifdef WITH_AVI
# include "AVI_avi.h"
@@ -74,13 +85,18 @@ static void filepath_avi(char *string, RenderData *rd);
bMovieHandle *BKE_movie_handle_get(const char imtype)
{
static bMovieHandle mh = {NULL};
+ /* stub callbacks in case none of the movie formats is supported */
+ mh.start_movie = start_stub;
+ mh.append_movie = append_stub;
+ mh.end_movie = end_stub;
+ mh.get_next_frame = NULL;
+ mh.get_movie_path = NULL;
/* set the default handle, as builtin */
#ifdef WITH_AVI
mh.start_movie = start_avi;
mh.append_movie = append_avi;
mh.end_movie = end_avi;
- mh.get_next_frame = NULL;
mh.get_movie_path = filepath_avi;
#endif
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs