videoblend: special case 1x1 src dims on increment computation
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Thu, 12 Nov 2015 22:01:03 +0000 (14:01 -0800)
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Mon, 28 Dec 2015 22:16:41 +0000 (14:16 -0800)
Fix crash with 1x1 overlay pixmap

https://bugzilla.gnome.org/show_bug.cgi?id=757290

gst-libs/gst/video/video-blend.c

index 8dc65c5..138a314 100644 (file)
@@ -186,12 +186,12 @@ gst_video_blend_scale_linear_RGBA (GstVideoInfo * src, GstBuffer * src_buffer,
   gst_video_frame_map (&src_frame, src, src_buffer, GST_MAP_READ);
   gst_video_frame_map (&dest_frame, dest, *dest_buffer, GST_MAP_WRITE);
 
-  if (dest_height == 1)
+  if (dest_height == 1 || src->height == 1)
     y_increment = 0;
   else
     y_increment = ((src->height - 1) << 16) / (dest_height - 1) - 1;
 
-  if (dest_width == 1)
+  if (dest_width == 1 || src->width == 1)
     x_increment = 0;
   else
     x_increment = ((src->width - 1) << 16) / (dest_width - 1) - 1;