Commit fa7454bd authored by Stefan Kost's avatar Stefan Kost
Browse files

gst/wavparse/gstwavparse.c: Make header field check conditional. Fixes #433135

Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers):
Make header field check conditional. Fixes #433135
parent 7002f033
2007-04-25 Stefan Kost <ensonic@users.sf.net>
* gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers):
Make header field check conditional. Fixes #433135
2007-04-24 Tim-Philipp Müller <tim at centricular dot net> 2007-04-24 Tim-Philipp Müller <tim at centricular dot net>
* docs/plugins/Makefile.am: * docs/plugins/Makefile.am:
......
...@@ -1078,10 +1078,6 @@ gst_wavparse_stream_headers (GstWavParse * wav) ...@@ -1078,10 +1078,6 @@ gst_wavparse_stream_headers (GstWavParse * wav)
/* do more sanity checks of header fields /* do more sanity checks of header fields
* (these can be sanitized by gst_riff_create_audio_caps() * (these can be sanitized by gst_riff_create_audio_caps()
*/ */
if (header->blockalign >
header->channels * (guint) ceil (header->size / 8.0))
goto invalid_blockalign;
wav->format = header->format; wav->format = header->format;
wav->rate = header->rate; wav->rate = header->rate;
wav->channels = header->channels; wav->channels = header->channels;
...@@ -1102,6 +1098,10 @@ gst_wavparse_stream_headers (GstWavParse * wav) ...@@ -1102,6 +1098,10 @@ gst_wavparse_stream_headers (GstWavParse * wav)
wav->bps = 0; wav->bps = 0;
break; break;
} }
case GST_RIFF_WAVE_FORMAT_PCM:
if (wav->blockalign > wav->channels * (guint) ceil (wav->depth / 8.0))
goto invalid_blockalign;
/* fall through */
default: default:
if (wav->av_bps > wav->blockalign * wav->rate) if (wav->av_bps > wav->blockalign * wav->rate)
goto invalid_bps; goto invalid_bps;
...@@ -1317,7 +1317,6 @@ invalid_blockalign: ...@@ -1317,7 +1317,6 @@ invalid_blockalign:
("Stream claims blockalign = %u, which is more than %u - invalid data", ("Stream claims blockalign = %u, which is more than %u - invalid data",
header->blockalign, header->blockalign,
header->channels * (guint) ceil (header->size / 8.0))); header->channels * (guint) ceil (header->size / 8.0)));
g_free (header);
g_free (codec_name); g_free (codec_name);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment