diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-21 22:00:19 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-21 22:01:14 +0100 |
commit | 8a6449167a6da8cb747cfe3502ae86ffaac2ed48 (patch) | |
tree | 9eeb1ea6dd521d048853531964db832c487a6031 | |
parent | 47619e41c4a1a39cfa04858c0ad629da30ee405c (diff) | |
download | ffmpeg-8a6449167a6da8cb747cfe3502ae86ffaac2ed48.tar.gz |
avcodec_decode_audio4: check got_frame_ptr before handling initial skip
Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 3d7540792e..313b45ad97 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1831,7 +1831,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, "skip %d samples due to side data\n", avctx->internal->skip_samples); } - if (avctx->internal->skip_samples) { + if (avctx->internal->skip_samples && *got_frame_ptr) { if(frame->nb_samples <= avctx->internal->skip_samples){ *got_frame_ptr = 0; avctx->internal->skip_samples -= frame->nb_samples; |