[FFmpeg-cvslog] vp3dec: fix null ptr derefernce.

Michael Niedermayer git at videolan.org
Sun Jun 17 19:57:45 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 17 19:50:58 2012 +0200| [1125606a1f8bdcabbdd9107831d20e86f0dfeeae] | committer: Michael Niedermayer

vp3dec: fix null ptr derefernce.

Fixes ticket1403

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1125606a1f8bdcabbdd9107831d20e86f0dfeeae
---

 libavcodec/vp3.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 923ddfb..81f6b89 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1667,7 +1667,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
     s->avctx = avctx;
     s->width = FFALIGN(avctx->width, 16);
     s->height = FFALIGN(avctx->height, 16);
-    if (avctx->pix_fmt == PIX_FMT_NONE)
+    if (avctx->codec_id != CODEC_ID_THEORA)
         avctx->pix_fmt = PIX_FMT_YUV420P;
     avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
     if(avctx->idct_algo==FF_IDCT_AUTO)
@@ -2315,6 +2315,8 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
     int header_len[3];
     int i;
 
+    avctx->pix_fmt = PIX_FMT_YUV420P;
+
     s->theora = 1;
 
     if (!avctx->extradata_size)



More information about the ffmpeg-cvslog mailing list