[FFmpeg-cvslog] avcodec/alac: Clear pointers in allocate_buffers()

Michael Niedermayer git at videolan.org
Mon Jul 20 10:48:28 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jul 13 15:46:10 2015 +0200| [0cb600b7bfb7ea1cc333cabce7d5c02a68bb15cb] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit f7068bf277a37479aecde2832208d820682b35e6)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0cb600b7bfb7ea1cc333cabce7d5c02a68bb15cb
---

 libavcodec/alac.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index ada7c73..d7aa7fb 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -533,6 +533,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);



More information about the ffmpeg-cvslog mailing list