mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
video-format: don't overrun the arrays on UYVP
This commit is contained in:
parent
700afbf6fd
commit
9b01d9a1d9
1 changed files with 3 additions and 2 deletions
|
@ -969,7 +969,7 @@ unpack_UYVP (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
||||||
const guint8 *s = GET_LINE (y);
|
const guint8 *s = GET_LINE (y);
|
||||||
guint16 *d = dest;
|
guint16 *d = dest;
|
||||||
|
|
||||||
for (i = 0; i < width; i += 2) {
|
for (i = 0; i < width - 1; i += 2) {
|
||||||
guint16 y0, y1;
|
guint16 y0, y1;
|
||||||
guint16 u0;
|
guint16 u0;
|
||||||
guint16 v0;
|
guint16 v0;
|
||||||
|
@ -1014,7 +1014,8 @@ pack_UYVP (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
||||||
guint16 v0;
|
guint16 v0;
|
||||||
|
|
||||||
y0 = s[4 * (i + 0) + 1];
|
y0 = s[4 * (i + 0) + 1];
|
||||||
y1 = s[4 * (i + 1) + 1];
|
y1 = (i < width - 1 ? s[4 * (i + 1) + 1] : y0);
|
||||||
|
|
||||||
u0 = s[4 * (i + 0) + 2];
|
u0 = s[4 * (i + 0) + 2];
|
||||||
v0 = s[4 * (i + 0) + 3];
|
v0 = s[4 * (i + 0) + 3];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue