GNOME Bugzilla – Bug 757290
gdkpixbufoverlay crash
Last modified: 2015-12-29 08:26:57 UTC
Created attachment 314372 [details] test image that cause the crash please test this pipeline with the attached png videotestsrc ! gdkpixbufoverlay location=/tmp/nera1.png overlay-width=10 overlay-height=10 ! xvimagesink you'll get this crash
+ Trace 235646
using an overlay image of different size make the pipeline work with no issue
special casing source dims on width or height == 1 goes around the problem for me but I'm not sure about the maths here. I understand its building up a 16.16 fixed point from the quotients but why the multiple -1s? shouldn't it just be numerator << 16 / denominator? Additionally, is there any documentation for video_orc_resample_bilinear_u32() and why aren't we using GstVideoScaler here? index 8dc65c5..138a314 100644 --- a/gst-libs/gst/video/video-blend.c +++ b/gst-libs/gst/video/video-blend.c @@ -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;
> why aren't we using GstVideoScaler here? This API precedes the video convert and scale API. It should be ported of course. > index 8dc65c5..138a314 100644 > --- a/gst-libs/gst/video/video-blend.c > +++ b/gst-libs/gst/video/video-blend.c > @@ -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; That make sense to me regardless what this code is about. It protects against having -1 here (which would go badly).
Thanks for taking a look Nic. Confirmed with Sebastian on IRC and I'm pushing the proposed fix and calling it done: commit e61f5b21385e5b0f5bce594477d757b841330d6e Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Date: Thu Nov 12 14:01:03 2015 -0800 videoblend: special case 1x1 src dims on increment computation Fix crash with 1x1 overlay pixmap [..]