diff --git a/starboard/xb1/shared/gpu_base_video_decoder.cc b/starboard/xb1/shared/gpu_base_video_decoder.cc index 84bab910f24a..ae0e0ec0f189 100644 --- a/starboard/xb1/shared/gpu_base_video_decoder.cc +++ b/starboard/xb1/shared/gpu_base_video_decoder.cc @@ -559,7 +559,9 @@ int GpuVideoDecoderBase::OnOutputRetrieved( if (is_hdr_video_) { image->AttachColorMetadata((*iter)->video_stream_info().color_metadata); } - written_inputs_.erase(iter); + if (iter != written_inputs_.cend()) { + written_inputs_.erase(iter); + } } scoped_refptr frame(new VideoFrameImpl( timestamp, std::bind(&GpuVideoDecoderBase::DeleteVideoFrame, this,