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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-30 14:07:50 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-30 14:07:50 +0400
commitb3704f45c4e165618e898b5b7d1a7391ad14dc50 (patch)
treeede24044252d222084cc59cef98e28ebfe8494c3 /source/blender/blenkernel/intern/sequencer.c
parent27ec8d5043f544685001aab3552b9b4b56bc1e1a (diff)
Fixes for snprintf usage:
* replace by BLI_snprintf in various places, note _snprintf on windows does not properly null terminate the string. * fix overflow in sequencer proxy code due to buffer being smaller than specified size. * fix some usage of snprintf as strcpy, this is will go wrong if the string contains % characters. * remove BLI_dynstr_printf function in gpu module, use BLI_dynstr_appendf
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 40e02d65323..9ef30bdd49b 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -78,11 +78,6 @@
# include "AUD_C-API.h"
#endif
-#ifdef WIN32
-#define snprintf _snprintf
-#endif
-
-
static ImBuf* seq_render_strip_stack(
SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
@@ -1193,7 +1188,7 @@ static void seq_open_anim_file(Sequence * seq)
static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, char * name)
{
int frameno;
- char dir[FILE_MAXDIR];
+ char dir[PROXY_MAXFILE];
int render_size = context.preview_render_size;
if (!seq->strip->proxy) {
@@ -1211,7 +1206,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
strcpy(dir, seq->strip->proxy->dir);
} else if (seq->type == SEQ_IMAGE) {
- snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
+ BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
} else {
return FALSE;
}
@@ -1232,14 +1227,14 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
/* generate a separate proxy directory for each preview size */
if (seq->type == SEQ_IMAGE) {
- snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir,
+ BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir,
context.preview_render_size,
give_stripelem(seq, cfra)->name);
frameno = 1;
} else {
frameno = (int) give_stripelem_index(seq, cfra)
+ seq->anim_startofs;
- snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
+ BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
context.preview_render_size);
}