From 6dd8c2fc3eae2c30f90696fcc49f89f79817a533 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Tue, 26 Jan 2010 18:46:06 -0800 Subject: [PATCH] fixed segv in ruby module --- lib/ruby/gfx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ruby/gfx.c b/lib/ruby/gfx.c index 9384d19..641388f 100644 --- a/lib/ruby/gfx.c +++ b/lib/ruby/gfx.c @@ -215,6 +215,9 @@ static VALUE image_rescale(VALUE cls, VALUE _width, VALUE _height) Get_Image(image2,v_image2) image2->doc = image->doc; image2->image = gfximage_rescale(image->image, width, height); + if(!image2->image) { + rb_raise(rb_eArgError, "Can't rescale to size %dx%d", width, height); + } return v_image2; } static VALUE image_save_jpeg(VALUE cls, VALUE _filename, VALUE quality) -- 1.7.10.4