Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2014-01-07 17:51:59 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-01-07 18:18:37 +0400
commite23bcbbb6d78709993b6187a2631eb20cd555e5a (patch)
treee07df1ed8f501078e1d29f9935757b1c79359c0c /source/blender/blenkernel/intern/writeavi.c
parent01df756bd10709bb707d4f88f14c50e5680d05a5 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/writeavi.c')
-rw-r--r--source/blender/blenkernel/intern/writeavi.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index 1d29ef70d8b..40bb593c108 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