mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
videoblend: Avoid assigning a negative value to a guint
There are some few but certain conditions where it is possible for the dest_width to be smaller than x. So we check this before assigning a negative value to src_width, which is a unsigned and would be promoted to a number that can segfault videoblend. https://bugzilla.gnome.org/show_bug.cgi?id=738242
This commit is contained in:
parent
1cc311156c
commit
3f5b9c4c8b
1 changed files with 4 additions and 2 deletions
|
@ -325,10 +325,12 @@ gst_video_blend (GstVideoFrame * dest,
|
|||
|
||||
/* adjust width/height if the src is bigger than dest */
|
||||
if (x + src_width > dest_width)
|
||||
src_width = dest_width - x;
|
||||
if (dest_width > x)
|
||||
src_width = dest_width - x;
|
||||
|
||||
if (y + src_height > dest_height)
|
||||
src_height = dest_height - y;
|
||||
if (dest_height > y)
|
||||
src_height = dest_height - y;
|
||||
|
||||
/* Mainloop doing the needed conversions, and blending */
|
||||
for (i = y; i < y + src_height; i++) {
|
||||
|
|
Loading…
Reference in a new issue