[FFmpeg-cvslog] swresample/soxr_resample: fix error handling

Rob Sykes git at videolan.org
Sun Dec 21 04:50:33 CET 2014


ffmpeg | branch: release/1.1 | Rob Sykes <aquegg at yahoo.co.uk> | Sat Dec 13 21:12:56 2014 +0100| [7520f1fb3acaf9f3b80db6d16cd7ca2b2ffcdec5] | committer: Michael Niedermayer

swresample/soxr_resample: fix error handling

Fixes CID1257659

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 4b6f2253741f3023928e61ae5105ccd4b1c515fb)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7520f1fb3acaf9f3b80db6d16cd7ca2b2ffcdec5
---

 libswresample/soxr_resample.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libswresample/soxr_resample.c b/libswresample/soxr_resample.c
index 15fcc83..57aa51a 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;
 }



More information about the ffmpeg-cvslog mailing list