aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Sykes <aquegg@yahoo.co.uk>2014-12-13 21:12:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:07 +0200
commit32d24c8c05a9e12bc71412831b2a430b7e3f66e2 (patch)
tree5549382f5db7d7bc8739d413f75cb1ff379d9f0b
parentb9ab59a82907eb557a2323b968708b57539861d5 (diff)
downloadffmpeg-32d24c8c05a9e12bc71412831b2a430b7e3f66e2.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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c
index 4c000db0ca..7467f8d5cc 100644
--- a/libswresample/soxr_resample.c
+++ b/libswresample/soxr_resample.c
@@ -76,8 +76,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;
}