From dd07d5932a1cfca785ffc04473ace75a5f6c6282 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Wed, 7 Sep 2011 15:21:38 +0000 Subject: [PATCH] Let VP8 decoder handle NULL codecSpecificInfo VP8Decoder::Decode() can now handle the case when codecSpecificInfo is NULL. Previously, it would crash. Review URL: http://webrtc-codereview.appspot.com/135015 git-svn-id: http://webrtc.googlecode.com/svn/trunk@554 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/video_coding/codecs/vp8/main/source/vp8.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc index a76982a4bf..2c3eb1f475 100644 --- a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc +++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc @@ -843,8 +843,11 @@ VP8Decoder::Decode(const EncodedImage& inputImage, // TODO(pw): how do we know it's a golden or alt reference frame? libvpx will // provide an API for now I added it temporarily - WebRtc_Word16 pictureId = codecSpecificInfo->codecSpecific.VP8.pictureId; - if (codecSpecificInfo && pictureId > -1) + WebRtc_Word16 pictureId = -1; + if (codecSpecificInfo) { + pictureId = codecSpecificInfo->codecSpecific.VP8.pictureId; + } + if (pictureId > -1) { if ((lastRefUpdates & VP8_GOLD_FRAME) || (lastRefUpdates & VP8_ALTR_FRAME))