Skip to content

Commit 67e401e

Browse files
committed
libswresample/audioconvert: Fix undefined NULL + 0
Affected 26 FATE tests like swr-resample_async-s16p-44100-8000. Signed-off-by: Andreas Rheinhardt <[email protected]> (cherry picked from commit 64977ed)
1 parent 789dadc commit 67e401e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libswresample/audioconvert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
237237
const int ich= ctx->ch_map ? ctx->ch_map[ch] : ch;
238238
const int is= ich < 0 ? 0 : (in->planar ? 1 : in->ch_count) * in->bps;
239239
const uint8_t *pi= ich < 0 ? ctx->silence : in->ch[ich];
240-
uint8_t *po= out->ch[ch];
241-
uint8_t *end= po + os*len;
240+
uint8_t *end, *po = out->ch[ch];
242241
if(!po)
243242
continue;
243+
end = po + os * len;
244244
ctx->conv_f(po+off*os, pi+off*is, is, os, end);
245245
}
246246
return 0;

0 commit comments

Comments
 (0)