mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
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
This commit is contained in:
parent
7002f0336b
commit
fa7454bda2
2 changed files with 9 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
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)
|
||||||
/* 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)
|
||||||
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:
|
||||||
("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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue