mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
vaapivideobufferpool: don't shift by negative since it's undefined
The function g_bit_nth_lsf() may return -1 if the request bit position is not avaible. Thus, this patch check if the return value is not -1 in order to continue.
This commit is contained in:
parent
19444ce184
commit
de0f8936f8
1 changed files with 6 additions and 3 deletions
|
@ -106,11 +106,14 @@ fill_video_alignment (GstVaapiVideoBufferPool * pool, GstVideoAlignment * align)
|
||||||
{
|
{
|
||||||
GstVideoInfo *const vip = &pool->priv->vmeta_vinfo;
|
GstVideoInfo *const vip = &pool->priv->vmeta_vinfo;
|
||||||
guint i;
|
guint i;
|
||||||
|
gint nth_bit;
|
||||||
|
|
||||||
gst_video_alignment_reset (align);
|
gst_video_alignment_reset (align);
|
||||||
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (vip); i++)
|
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (vip); i++) {
|
||||||
align->stride_align[i] =
|
nth_bit = g_bit_nth_lsf (GST_VIDEO_INFO_PLANE_STRIDE (vip, i), 0);
|
||||||
(1U << g_bit_nth_lsf (GST_VIDEO_INFO_PLANE_STRIDE (vip, i), 0)) - 1;
|
if (nth_bit >= 0)
|
||||||
|
align->stride_align[i] = (1U << nth_bit) - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const gchar **
|
static const gchar **
|
||||||
|
|
Loading…
Reference in a new issue