[FFmpeg-cvslog] asv1dec: check extradatasize before reading.
Michael Niedermayer
git at videolan.org
Sun Apr 22 12:30:51 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 22 12:16:29 2012 +0200| [605f2b6b004eee4dc57832257169ff8eaa562fb7] | committer: Michael Niedermayer
asv1dec: check extradatasize before reading.
Fixes null ptr dereference
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=605f2b6b004eee4dc57832257169ff8eaa562fb7
---
libavcodec/asv1.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c
index c6e0c53..702a59e 100644
--- a/libavcodec/asv1.c
+++ b/libavcodec/asv1.c
@@ -553,8 +553,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
avctx->pix_fmt= PIX_FMT_YUV420P;
- a->inv_qscale= avctx->extradata[0];
- if(a->inv_qscale == 0){
+ if(avctx->extradata_size < 1 || (a->inv_qscale= avctx->extradata[0]) == 0){
av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n");
if(avctx->codec_id == CODEC_ID_ASV1)
a->inv_qscale= 6;
More information about the ffmpeg-cvslog
mailing list