mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 19:55:32 +00:00
videotestsrc: fix undefined behaviour of left-shift
With a small type for the color values being left-shifted, the result is undefined and it could potentially overflow. https://bugzilla.gnome.org/show_bug.cgi?id=729195
This commit is contained in:
parent
740258acf6
commit
954db90918
1 changed files with 2 additions and 2 deletions
|
@ -1134,9 +1134,9 @@ paint_tmpline_AYUV (paintinfo * p, int x, int w)
|
||||||
|
|
||||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||||
value = (p->color->A << 0) | (p->color->Y << 8) |
|
value = (p->color->A << 0) | (p->color->Y << 8) |
|
||||||
(p->color->U << 16) | (p->color->V << 24);
|
(p->color->U << 16) | ((guint32) p->color->V << 24);
|
||||||
#else
|
#else
|
||||||
value = (p->color->A << 24) | (p->color->Y << 16) |
|
value = ((guint32) p->color->A << 24) | (p->color->Y << 16) |
|
||||||
(p->color->U << 8) | (p->color->V << 0);
|
(p->color->U << 8) | (p->color->V << 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue