From 81d3ba3fa212bb25fe2ac661993887c4b69af6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 15 Jan 2017 18:31:56 +0100 Subject: [PATCH] riff-media: Check for valid channels/rate before using the values Otherwise we might divide by zero or otherwise create invalid caps. https://bugzilla.gnome.org/show_bug.cgi?id=777262 --- gst-libs/gst/riff/riff-media.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Index: gst-plugins-base0.10-0.10.36/gst-libs/gst/riff/riff-media.c =================================================================== --- gst-plugins-base0.10-0.10.36.orig/gst-libs/gst/riff/riff-media.c 2017-03-23 13:06:30.955651882 -0400 +++ gst-plugins-base0.10-0.10.36/gst-libs/gst/riff/riff-media.c 2017-03-23 13:06:30.951651834 -0400 @@ -1495,7 +1495,8 @@ subformat_guid[2] == 0xaa000080 && subformat_guid[3] == 0x719b3800) { if (subformat_guid[0] == 0x00000001) { GST_DEBUG ("PCM"); - if (strf != NULL) { + if (strf != NULL && strf->blockalign != 0 && strf->channels != 0 + && strf->rate != 0) { gint ba = strf->blockalign; gint wd = ba * 8 / strf->channels; gint ws; @@ -1541,7 +1542,8 @@ } } else if (subformat_guid[0] == 0x00000003) { GST_DEBUG ("FLOAT"); - if (strf != NULL) { + if (strf != NULL && strf->blockalign != 0 && strf->channels != 0 + && strf->rate != 0) { gint ba = strf->blockalign; gint wd = ba * 8 / strf->channels;