commit | 64339a7069258fe8fb5b2aab6b8145990b568c9c | [log] [tgz] |
---|---|---|
author | stefan@webrtc.org <stefan@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | Mon May 19 13:31:35 2014 +0000 |
committer | stefan@webrtc.org <stefan@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | Mon May 19 13:31:35 2014 +0000 |
tree | d28a4209c4edc21b0de54a049e523f156982f6b4 | |
parent | 725e5824618c120094d019be34fdf7572813723c [diff] |
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
diff --git a/webrtc/modules/video_coding/main/source/generic_decoder.cc b/webrtc/modules/video_coding/main/source/generic_decoder.cc index 07663e1..cb0faf9 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 @@ _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(),