forked from bartvdbraak/blender
- Bugfix #3271: saveRenderedImage() was corrupting memory while trying to
build the filename (thanks for good bug report, Pablo)
This commit is contained in:
parent
d7be29b376
commit
3dbe0f0074
@ -892,15 +892,18 @@ PyObject *RenderData_Render( BPy_RenderData * self )
|
||||
PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args )
|
||||
{
|
||||
char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2], strn[256];
|
||||
char *name_str, *filepath;
|
||||
PyObject *renderPath;
|
||||
char *name_str, filepath[FILE_MAXDIR+FILE_MAXFILE];
|
||||
|
||||
if( !PyArg_ParseTuple( args, "s", &name_str ) ){
|
||||
return (EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"expected a filename (string)" ));
|
||||
}
|
||||
renderPath = RenderData_GetRenderPath(self);
|
||||
filepath = PyString_AsString(renderPath);
|
||||
if( !PyArg_ParseTuple( args, "s", &name_str ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"expected a filename (string)" );
|
||||
|
||||
if( strlen(self->renderContext->pic) + strlen(name_str) >
|
||||
sizeof(filepath)-1 )
|
||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||
"full filename too long" );
|
||||
|
||||
BLI_strncpy( filepath, self->renderContext->pic, sizeof(filepath) );
|
||||
strcat(filepath, name_str);
|
||||
|
||||
if(!R.rectot) {
|
||||
|
Loading…
Reference in New Issue
Block a user