1 Apr 2012 03:33
lavc: check media type of the decoder before calling it.
Michael Niedermayer <git <at> videolan.org>
2012-04-01 01:33:24 GMT
2012-04-01 01:33:24 GMT
ffmpeg | branch: master | Michael Niedermayer <michaelni <at> gmx.at> | Sun Apr 1 02:57:27 2012 +0200| [7c9d69360cd29415591816b70e722235a4319e08] | committer: Michael Niedermayer lavc: check media type of the decoder before calling it. This fixes a segfault where a video decoder was called from avcodec_decode_audio*(). 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=7c9d69360cd29415591816b70e722235a4319e08 --- libavcodec/utils.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9c662c2..e63878d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c <at> <at> -1404,6 +1404,11 <at> <at> int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi // copy to ensure we do not change avpkt AVPacket tmp = *avpkt; + if (avctx->codec->type != AVMEDIA_TYPE_VIDEO) { + av_log(avctx, AV_LOG_ERROR, "Invalid media type for video\n"); + return AVERROR(EINVAL); + }(Continue reading)
RSS Feed