From cb6dfffa44a3ed76105eb55d8ad5f6f0b7429f50 Mon Sep 17 00:00:00 2001 From: Diego Hernan Borghetti Date: Tue, 25 Mar 2008 15:15:02 -0300 Subject: [PATCH] Raise the limit for long filenames. a few times peach guys have had the play button fail with "stack smash" warnings in the terminal and play button not working. This fixes a reproducible crash where blender would segfault when pressing play on long filenames, and hopefully fixes odd user reports where pressing play quits X11 or reboots their system. Author: Campbell Barton SVN revision: 14235 Date: 2008-03-25 06:40:06 -0300 (Tue, 25 Mar 2008) --- source/blender/src/buttons_scene.c | 2 +- source/blender/src/playanim.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 2463b26..ec8a99f 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1126,7 +1126,7 @@ static void ftype_pic(char *name) static void run_playanim(char *file) { extern char bprogname[]; /* usiblender.c */ - char str[FILE_MAX]; + char str[FILE_MAX*2]; /* FILE_MAX*2 is a bit arbitary, but this should roughly allow for the args + the max-file-length */ int pos[2], size[2]; /* use current settings for defining position of window. it actually should test image size */ diff --git a/source/blender/src/playanim.c b/source/blender/src/playanim.c index 5136d52..fa13c2e 100644 --- a/source/blender/src/playanim.c +++ b/source/blender/src/playanim.c @@ -202,7 +202,7 @@ static void toscreen(Pict *picture, struct ImBuf *ibuf) pupdate_time(); if(picture && (qualN & (SHIFT|LMOUSE))) { - char str[256]; + char str[512]; cpack(-1); glRasterPos2f(0.02f, 0.03f); sprintf(str, "%s | %.2f frames/s\n", picture->name, 1.0 / swaptime); @@ -215,12 +215,12 @@ static void toscreen(Pict *picture, struct ImBuf *ibuf) static void build_pict_list(char * first) { int size,pic,file; - char *mem, name[256]; + char *mem, name[512]; short val; struct pict * picture = 0; struct ImBuf *ibuf = 0; int count = 0; - char str[100]; + char str[512]; struct anim * anim; if (IMB_isanim(first)) { @@ -336,7 +336,7 @@ void playanim(int argc, char **argv) { struct ImBuf *ibuf = 0; struct pict *picture = 0; - char name[256]; + char name[512]; short val = 0, go = TRUE, ibufx = 0, ibufy = 0; int event, stopped = FALSE, maxwinx, maxwiny; short /* c233 = FALSE, */ /* yuvx = FALSE, */ once = FALSE, sstep = FALSE, wait2 = FALSE, /* resetmap = FALSE, */ pause = 0; -- 2.11.4.GIT