mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 03:56:16 +00:00
videotestsrc: fix segfault on negative horizontal-speed
This commit is contained in:
parent
75b522dacf
commit
ef02142125
1 changed files with 2 additions and 0 deletions
|
@ -608,6 +608,8 @@ videotestsrc_setup_paintinfo (GstVideoTestSrc * v, paintinfo * p, int w, int h)
|
||||||
p->tmpline2 = v->tmpline2;
|
p->tmpline2 = v->tmpline2;
|
||||||
p->tmpline_u8 = v->tmpline_u8;
|
p->tmpline_u8 = v->tmpline_u8;
|
||||||
p->x_offset = (v->horizontal_speed * v->n_frames) % p->width;
|
p->x_offset = (v->horizontal_speed * v->n_frames) % p->width;
|
||||||
|
if (p->x_offset < 0)
|
||||||
|
p->x_offset += p->width;
|
||||||
|
|
||||||
a = (v->foreground_color >> 24) & 0xff;
|
a = (v->foreground_color >> 24) & 0xff;
|
||||||
r = (v->foreground_color >> 16) & 0xff;
|
r = (v->foreground_color >> 16) & 0xff;
|
||||||
|
|
Loading…
Reference in a new issue