[FFmpeg-cvslog] avcodec_decode_audio4: check got_frame_ptr before handling initial skip
Michael Niedermayer
git at videolan.org
Thu Feb 21 22:29:38 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Feb 21 22:00:19 2013 +0100| [8a6449167a6da8cb747cfe3502ae86ffaac2ed48] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a6449167a6da8cb747cfe3502ae86ffaac2ed48
---
libavcodec/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3d75407..313b45a 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;
More information about the ffmpeg-cvslog
mailing list