From 459f3aa4f97646a71f4a440c347dca124c0f71ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Nov 2014 03:49:22 +0100 Subject: ao_lavc: fix dangling pointers Found by Coverity. --- audio/out/ao_lavc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c index 9f2179e8f7..5f31ef3885 100644 --- a/audio/out/ao_lavc.c +++ b/audio/out/ao_lavc.c @@ -353,12 +353,12 @@ static int play(struct ao *ao, void **data, int samples, int flags) size_t num_planes = af_fmt_is_planar(ao->format) ? ao->channels.num : 1; void *tempdata = NULL; + void *padded[MP_NUM_CHANNELS]; if ((flags & AOPLAY_FINAL_CHUNK) && (samples % ac->aframesize)) { tempdata = talloc_new(NULL); size_t bytelen = samples * ao->sstride; size_t extralen = (ac->aframesize - 1) * ao->sstride; - void *padded[MP_NUM_CHANNELS]; for (int n = 0; n < num_planes; n++) { padded[n] = talloc_size(tempdata, bytelen + extralen); memcpy(padded[n], data[n], bytelen); -- cgit v1.2.3