Browse Source

fix incorrect errors when using an integer format ImageData

Sasha Szpakowski 1 year ago
parent
commit
58f05eb000
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/modules/image/wrap_ImageData.lua

+ 3 - 3
src/modules/image/wrap_ImageData.lua

@@ -342,9 +342,9 @@ local objectcache = setmetatable({}, {
 			width = width,
 			width = width,
 			height = height,
 			height = height,
 			format = format,
 			format = format,
-			pointer = conv == nil and nil or ffi.cast(conv.pointer, imagedata:getFFIPointer()),
-			tolua = conv == nil and nil or conv.tolua,
-			fromlua = conv == nil and nil or conv.fromlua,
+			pointer = conv ~= nil and ffi.cast(conv.pointer, imagedata:getFFIPointer()) or nil,
+			tolua = conv ~= nil and conv.tolua or nil,
+			fromlua = conv ~= nil and conv.fromlua or nil,
 		}
 		}
 
 
 		self[imagedata] = p
 		self[imagedata] = p