aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-26 09:43:22 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-02 21:39:54 +0200
commit67e401e3cb0bf8d3a6f13828d9905be75cf969fd (patch)
tree40af6757dcb2c62dd9ef2746a7c26de3f81690b0 /libswresample
parent789dadccc063eb05659e30e7aeb1da4f8ffdf208 (diff)
downloadffmpeg-67e401e3cb0bf8d3a6f13828d9905be75cf969fd.tar.gz
libswresample/audioconvert: Fix undefined NULL + 0
Affected 26 FATE tests like swr-resample_async-s16p-44100-8000. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit 64977ed7ae1e437910ca837ccb282e07d9200249)
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/audioconvert.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c
index 89ee7bfae3..500aa0e5c5 100644
--- a/libswresample/audioconvert.c
+++ b/libswresample/audioconvert.c
@@ -237,10 +237,10 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
const int ich= ctx->ch_map ? ctx->ch_map[ch] : ch;
const int is= ich < 0 ? 0 : (in->planar ? 1 : in->ch_count) * in->bps;
const uint8_t *pi= ich < 0 ? ctx->silence : in->ch[ich];
- uint8_t *po= out->ch[ch];
- uint8_t *end= po + os*len;
+ uint8_t *end, *po = out->ch[ch];
if(!po)
continue;
+ end = po + os * len;
ctx->conv_f(po+off*os, pi+off*is, is, os, end);
}
return 0;