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