From 3d7a5666402d7c911303ebf718cf003eccffded5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 24 Nov 2016 15:12:40 +0200 Subject: [PATCH] video-info: And change the overflow check to not actually overflow itself --- gst-libs/gst/video/video-info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index 61614b5889..f569d492a8 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -684,8 +684,8 @@ fill_planes (GstVideoInfo * info) for (i = 0; i < GST_VIDEO_INFO_N_COMPONENTS (info); i++) bpp += GST_VIDEO_INFO_COMP_DEPTH (info, i); bpp = GST_ROUND_UP_8 (bpp) / 8; - if (GST_ROUND_UP_128 ((guint64) width) * ((guint64) height) * bpp >= - G_MAXUINT) { + if (bpp > 0 && GST_ROUND_UP_128 ((guint64) width) * ((guint64) height) >= + G_MAXUINT / bpp) { GST_ERROR ("Frame size %ux%u would overflow", info->width, info->height); return FALSE; }