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 )
|
PyObject *RenderData_SaveRenderedImage ( BPy_RenderData * self, PyObject *args )
|
||||||
{
|
{
|
||||||
char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2], strn[256];
|
char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2], strn[256];
|
||||||
char *name_str, *filepath;
|
char *name_str, filepath[FILE_MAXDIR+FILE_MAXFILE];
|
||||||
PyObject *renderPath;
|
|
||||||
|
|
||||||
if( !PyArg_ParseTuple( args, "s", &name_str ) ){
|
if( !PyArg_ParseTuple( args, "s", &name_str ) )
|
||||||
return (EXPP_ReturnPyObjError( PyExc_AttributeError,
|
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||||
"expected a filename (string)" ));
|
"expected a filename (string)" );
|
||||||
}
|
|
||||||
renderPath = RenderData_GetRenderPath(self);
|
if( strlen(self->renderContext->pic) + strlen(name_str) >
|
||||||
filepath = PyString_AsString(renderPath);
|
sizeof(filepath)-1 )
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
|
"full filename too long" );
|
||||||
|
|
||||||
|
BLI_strncpy( filepath, self->renderContext->pic, sizeof(filepath) );
|
||||||
strcat(filepath, name_str);
|
strcat(filepath, name_str);
|
||||||
|
|
||||||
if(!R.rectot) {
|
if(!R.rectot) {
|
||||||
|
Loading…
Reference in New Issue
Block a user