GNOME Bugzilla – Bug 738984
basetextoverlay: segfault for min/max values of element properties
Last modified: 2015-03-29 14:19:44 UTC
Created attachment 289101 [details] [review] proposed patch In basetextoverlay added *ypos = 0; Since setting ypos is added in else case, there are cases where ypos has a junk value when the else condition is not satisfied. Hence initializing the value to 0 in the beginning. In Video-blend changes Right now the condition is like this if (x + src_width > dest_width) if (dest_width > x) src_width = dest_width - x; But with this chances are there when src_width will not be re-calculated and it will be more that the width of the video, which results in segfault. The better way is to set the *xpos and *ypos to 0 in basetextoverlay, in case they lie outside the video width and height, since anyways we are not going to show the same. Please check if they are valid.
Can you split this patch into two and create a testcase?
Review of attachment 289101 [details] [review]: ::: gst-libs/gst/video/video-blend.c @@ -331,3 @@ if (y + src_height > dest_height) - if (dest_height > y) - src_height = dest_height - y; Can't this become negative now?
Created attachment 289190 [details] [review] basetextoverlay segfault fix Splitting the patch into two i have been testing with below two test cases.. gst-launch-1.0 filesrc location=../wonder.mp4 ! decodebin ! videoconvert ! textoverlay deltay=-2147483648 text=text ! videoconvert ! ximagesink gst-launch-1.0 filesrc location=../wonder.mp4 ! decodebin ! videoconvert ! textoverlay deltax=-2147483648 text=adasldjalskdjlsakjdklasjdlkjsalkdjslakdjklasjdlkasjdlkasjdklasjdkljaskldjaslkjdlkasjdlkasjdklasjdkasjdlkasjdlkajskdljaslkdjalksjdlkasjdlkasjdlkasjdlksajdlkjaskdljaskldjlaksjdlksajdalksjdaslkjdklasjdlkasjdlksajdmake ! videoconvert ! ximagesink in video-blend.c I am just reverting the changes done in last submission. x position is calculated in basetextoverlay, such that when x crosses the dest width, it is reset to 0.. This should be taken care by all elements which uses video-blend. This is similar to how src width can never be greater than dest width, which should again be taken care by all elements using video-blend PS:IRC is not accesible in office due to proxy issues :(. Else it would be easier to explain..
Created attachment 289191 [details] [review] video-blend segfault fix
After some consideration, I agree this is a better solution. Sorry about my bad patch. Merged these two patches.
Comment on attachment 289190 [details] [review] basetextoverlay segfault fix Accepted
Comment on attachment 289191 [details] [review] video-blend segfault fix accepted
Comment on attachment 289190 [details] [review] basetextoverlay segfault fix (This was reverted later, marking as such)