Slight tidy-up of the code.

This commit is contained in:
Tigran Aivazian authored and Qingping Hou committed 2012-10-31 20:45:50 -04:00
1 parent cac63cd390
commit 7609fc2dd0
1 file changed
+3 -5
+3 -5
View File
@@ -137,13 +137,11 @@ static int openDocument(lua_State *L) {
doc->image = raw_image;
else if (components == 3) {
uint8_t *gray_image = rgbToGrayscale(raw_image, width, height);
if (!gray_image) {
free(raw_image);
free(raw_image);
if (!gray_image)
return luaL_error(L, "Cannot convert to grayscale");
} else {
free(raw_image);
else
doc->image = gray_image;
}
} else
return luaL_error(L, "Unsupported image format");