Bug 1329104 - Shutdown context used for WebM alpha decoding. r?jya draft
authorkaro <kkoorts@mozilla.com>
Tue, 17 Jan 2017 08:56:27 +1300
changeset 462237 f1a018417190cb04bd3d464a967dc025eb201a5f
parent 461077 50bd08fad34963be3ab52cb25a1c3e08e056f2cc
child 542327 6d68fc1d7658f2bf7cf4b91197a5b166560705f3
push id41682
push userbmo:kkoorts@mozilla.com
push dateMon, 16 Jan 2017 21:47:05 +0000
reviewersjya
bugs1329104
milestone53.0a1
Bug 1329104 - Shutdown context used for WebM alpha decoding. r?jya Fixes leak due to context used for decoding alpha in WebM videos not shutting down. MozReview-Commit-ID: 5ZWHM7xvxiV
dom/media/platforms/agnostic/VPXDecoder.cpp
--- a/dom/media/platforms/agnostic/VPXDecoder.cpp
+++ b/dom/media/platforms/agnostic/VPXDecoder.cpp
@@ -83,16 +83,19 @@ VPXDecoder::~VPXDecoder()
 {
   MOZ_COUNT_DTOR(VPXDecoder);
 }
 
 void
 VPXDecoder::Shutdown()
 {
   vpx_codec_destroy(&mVPX);
+  if (mInfo.HasAlpha()) {
+    vpx_codec_destroy(&mVPXAlpha);
+  }
 }
 
 RefPtr<MediaDataDecoder::InitPromise>
 VPXDecoder::Init()
 {
   if (NS_FAILED(InitContext(&mVPX, mInfo, mCodec))) {
     return VPXDecoder::InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                                                     __func__);