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
This commit is contained in:
henrik.lundin@webrtc.org 2011-09-07 15:21:38 +00:00
parent ea05973e68
commit dd07d5932a

View File

@ -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))