diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-11-24 15:12:40 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-11-24 15:12:40 +0200 |
commit | 3d7a5666402d7c911303ebf718cf003eccffded5 (patch) | |
tree | 4f6030d6a47ec2a754fb7bab3c9578bc05f395e8 | |
parent | 681d97aed7a9a4e4804963a8e174d2daa7f96938 (diff) |
video-info: And change the overflow check to not actually overflow itself
-rw-r--r-- | gst-libs/gst/video/video-info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index 61614b588..f569d492a 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; } |