Initialize doc->image in openDocument

This is needed to protect against double free() in closeDocument().
pull/2/merge
Tigran Aivazian 12 years ago committed by Qingping Hou
parent 01ce094adb
commit 8c6fd35789

@ -133,6 +133,7 @@ static int openDocument(lua_State *L) {
if (!raw_image)
return luaL_error(L, "Cannot open jpeg file");
doc->image = NULL;
if (components == 1)
doc->image = raw_image;
else if (components == 3) {

Loading…
Cancel
Save