aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-13 15:46:10 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-18 20:23:46 +0200
commit264eb0074f3b0591c9430b20927d6547c8757c48 (patch)
treed04aa9a92dab0115f6398713a2e85dfb7acf44ac
parent7db809a373f0fb066eea20883d1ba3b35fcbfe70 (diff)
downloadffmpeg-264eb0074f3b0591c9430b20927d6547c8757c48.tar.gz
avcodec/alac: Clear pointers in allocate_buffers()
Fixes: 06a4edb39ad8a9883175f9bd428334a2_signal_sigsegv_7ffff713351a_706_mov__alac__ALAC_6ch.mov Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f7068bf277a37479aecde2832208d820682b35e6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/alac.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index b0527f1439..a5948bba7e 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -534,6 +534,12 @@ static int allocate_buffers(ALACContext *alac)
int ch;
int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
+ for (ch = 0; ch < 2; ch++) {
+ alac->predict_error_buffer[ch] = NULL;
+ alac->output_samples_buffer[ch] = NULL;
+ alac->extra_bits_buffer[ch] = NULL;
+ }
+
for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
buf_size, buf_alloc_fail);