From 196b885a5f0aa3ca022c1fa99509f47341239784 Mon Sep 17 00:00:00 2001 From: Ganesh Ajjanagadde Date: Tue, 2 Jun 2015 23:17:48 -0400 Subject: swresample/dither: check memory allocation check memory allocation in swri_get_dither() Signed-off-by: Michael Niedermayer --- libswresample/swresample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libswresample/swresample.c') diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 3d3ab83fd9..87ad7f8d78 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -627,7 +627,8 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co return ret; if(ret) for(ch=0; chdither.noise.ch_count; ch++) - swri_get_dither(s, s->dither.noise.ch[ch], s->dither.noise.count, 12345678913579<dither.noise.fmt); + if((ret=swri_get_dither(s, s->dither.noise.ch[ch], s->dither.noise.count, 12345678913579<dither.noise.fmt))<0) + return ret; av_assert0(s->dither.noise.ch_count == preout->ch_count); if(s->dither.noise_pos + out_count > s->dither.noise.count) -- cgit v1.2.3