mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 04:58:47 +00:00
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
This commit is contained in:
parent
3bf38e4e1b
commit
81d3ba3fa2
1 changed files with 4 additions and 2 deletions
|
@ -1615,7 +1615,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
|
|||
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;
|
||||
|
@ -1648,7 +1649,8 @@ gst_riff_create_audio_caps (guint16 codec_id,
|
|||
}
|
||||
} 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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue