diff options
author | Rob Sykes <aquegg@yahoo.co.uk> | 2014-12-13 21:12:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-21 04:40:35 +0100 |
commit | 7520f1fb3acaf9f3b80db6d16cd7ca2b2ffcdec5 (patch) | |
tree | 39b6bd270b11ee9c56a85851eeebe38136d8503f | |
parent | 437e50b3d65fecd374b56c39c55bc6d340004502 (diff) | |
download | ffmpeg-7520f1fb3acaf9f3b80db6d16cd7ca2b2ffcdec5.tar.gz |
swresample/soxr_resample: fix error handling
Fixes CID1257659
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b6f2253741f3023928e61ae5105ccd4b1c515fb)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libswresample/soxr_resample.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c index 15fcc83bf1..57aa51a53b 100644 --- a/libswresample/soxr_resample.c +++ b/libswresample/soxr_resample.c @@ -72,8 +72,12 @@ static int process( AudioData *src, int src_size, int *consumed){ size_t idone, odone; soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count)); - error = soxr_process((soxr_t)c, src->ch, (size_t)src_size, - &idone, dst->ch, (size_t)dst_size, &odone); + if (!error) + error = soxr_process((soxr_t)c, src->ch, (size_t)src_size, + &idone, dst->ch, (size_t)dst_size, &odone); + else + idone = 0; + *consumed = (int)idone; return error? -1 : odone; } |