Index: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc |
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc |
index e79fdfb69841576fbb790972d9d3e211d346409d..20d8aef55e08e8b786fbd6258c5c6511490f2d72 100644 |
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc |
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.cc |
@@ -164,6 +164,10 @@ int H264VideoToolboxDecoder::RegisterDecodeCompleteCallback( |
} |
int H264VideoToolboxDecoder::Release() { |
+ // Need to invalidate the session so that callbacks no longer occur and it |
+ // is safe to null out the callback. |
+ DestroyDecompressionSession(); |
+ SetVideoFormat(nullptr); |
callback_ = nullptr; |
return WEBRTC_VIDEO_CODEC_OK; |
} |