summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-21 03:49:22 +0100
committerwm4 <wm4@nowhere>2014-11-21 03:50:52 +0100
commit459f3aa4f97646a71f4a440c347dca124c0f71ce (patch)
tree1ef73bac7988b72165a3261bb33612cde02e7382 /audio
parent78fe4f1bd4f5fc1b41aa977724f5e41df4a58e23 (diff)
downloadmpv-459f3aa4f97646a71f4a440c347dca124c0f71ce.tar.bz2
mpv-459f3aa4f97646a71f4a440c347dca124c0f71ce.tar.xz
ao_lavc: fix dangling pointers
Found by Coverity.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_lavc.c2
1 files changed, 1 insertions, 1 deletions
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);