summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-11 21:10:53 +0100
committerwm4 <wm4@nowhere>2014-11-11 21:10:53 +0100
commit475226c783cd3ce17a90ee5312727e013b2436cf (patch)
treed85e02103d565751c3436c30d33ace259a4796f3
parentc827ae5f3603378b291d0575920e0cf87f5d0bfe (diff)
downloadmpv-475226c783cd3ce17a90ee5312727e013b2436cf.tar.bz2
mpv-475226c783cd3ce17a90ee5312727e013b2436cf.tar.xz
audio: refuse to allocate frames in invalid format
-rw-r--r--audio/audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 7721fa4d0b..24539e6db5 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -128,7 +128,7 @@ void mp_audio_set_null_data(struct mp_audio *mpa)
static int get_plane_size(const struct mp_audio *mpa, int samples)
{
- if (samples < 0 || !mpa->format)
+ if (samples < 0 || !mp_audio_config_valid(mpa))
return -1;
if (samples >= INT_MAX / mpa->sstride)
return -1;