-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Labels
Description
image.write_to_memory
sometimes raises a FFI::NullPointerError
if the image has invalid image data.
To Reproduce
Steps to reproduce the behavior:
coffee-19613_128.gif
null_pointer_error.rb:
require "vips"
img = Vips::Image.new_from_file "coffee-19613_128.gif"
img.write_to_memory
$ ruby null_pointer_error.rb
(process:32892): VIPS-WARNING **: 11:54:17.971: Unexpected end of GIF source data
(process:32892): VIPS-WARNING **: 11:54:17.972: error in tile 0 x 0
ruby-vips-2.2.3/lib/vips/image.rb:708:in 'FFI::AbstractMemory#get_bytes': invalid memory read at address=0x0000000000000000 (FFI::NullPointerError)
from ruby-vips-2.2.3/lib/vips/image.rb:708:in 'Vips::Image#write_to_memory'
from null_pointer_error.rb:4:in '<main>
Expected behavior
Vips::Error
raised instead
ruby-vips version: v2.2.3
libvips version: v8.16.1