[FFmpeg-cvslog] avcodec/alac: only set *got_frame_ptr when all channels have been decoded

Michael Niedermayer git at videolan.org
Mon Jan 13 17:28:58 CET 2014


ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Sat Jan 11 04:36:15 2014 +0100| [b3c3dc54a595c0145c2efa4f68728aa928a9c854] | committer: Michael Niedermayer

avcodec/alac: only set *got_frame_ptr when all channels have been decoded

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f8b64436530_7895_quicktime_newcodec_applelosslessaudiocodec.m4a
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit e11983bda073f8c63f60509ee753da9fba20ed10)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/alac.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 3f37f61..1929839 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -490,7 +490,8 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
                avpkt->size * 8 - get_bits_count(&alac->gb));
     }
 
-    *got_frame_ptr = 1;
+    if (alac->channels == ch)
+        *got_frame_ptr = 1;
 
     return avpkt->size;
 }



More information about the ffmpeg-cvslog mailing list