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@gmx.at>
(cherry picked from commit e11983bda0
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -490,6 +490,7 @@ static int alac_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
avpkt->size * 8 - get_bits_count(&alac->gb));
|
avpkt->size * 8 - get_bits_count(&alac->gb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (alac->channels == ch)
|
||||||
*got_frame_ptr = 1;
|
*got_frame_ptr = 1;
|
||||||
|
|
||||||
return avpkt->size;
|
return avpkt->size;
|
||||||
|
Reference in New Issue
Block a user