From 64339a7069258fe8fb5b2aab6b8145990b568c9c Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Mon, 19 May 2014 13:31:35 +0000 Subject: [PATCH] Don't crash if a frame returned from the decoder is too old. BUG=crbug/371805 R=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16559004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6187 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/video_coding/main/source/generic_decoder.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/video_coding/main/source/generic_decoder.cc b/webrtc/modules/video_coding/main/source/generic_decoder.cc index 07663e1bb..cb0faf9a9 100644 --- a/webrtc/modules/video_coding/main/source/generic_decoder.cc +++ b/webrtc/modules/video_coding/main/source/generic_decoder.cc @@ -58,7 +58,12 @@ int32_t VCMDecodedFrameCallback::Decoded(I420VideoFrame& decodedImage) _timestampMap.Pop(decodedImage.timestamp())); callback = _receiveCallback; } - assert(frameInfo != NULL); + + if (frameInfo == NULL) { + LOG(LS_WARNING) << "Too many frames backed up in the decoder, dropping " + "this one."; + return WEBRTC_VIDEO_CODEC_OK; + } _timing.StopDecodeTimer( decodedImage.timestamp(),