summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-05-25 21:53:19 +0200
committerGitHub <noreply@github.com>2018-05-25 21:53:19 +0200
commitedccc615f9435d658febac9be2299542349e2b08 (patch)
treeca3fcaa2a72700b85221b2fe75bb7d46d5d424ce /dom
parentb43a5fbedae602d0025ffdda8929e5bee9e2ca0b (diff)
parentf2d541d3ea44b56d3c4ce47fe7b326e58abc786f (diff)
downloadUXP-edccc615f9435d658febac9be2299542349e2b08.tar
UXP-edccc615f9435d658febac9be2299542349e2b08.tar.gz
UXP-edccc615f9435d658febac9be2299542349e2b08.tar.lz
UXP-edccc615f9435d658febac9be2299542349e2b08.tar.xz
UXP-edccc615f9435d658febac9be2299542349e2b08.zip
Merge pull request #385 from trav90/media-work
Fix null checks in dom/media
Diffstat (limited to 'dom')
-rw-r--r--dom/media/ipc/VideoDecoderChild.cpp1
-rw-r--r--dom/media/ipc/VideoDecoderManagerParent.cpp2
-rw-r--r--dom/media/ogg/OggCodecState.cpp7
3 files changed, 6 insertions, 4 deletions
diff --git a/dom/media/ipc/VideoDecoderChild.cpp b/dom/media/ipc/VideoDecoderChild.cpp
index d1b1d23fc..f01d3c659 100644
--- a/dom/media/ipc/VideoDecoderChild.cpp
+++ b/dom/media/ipc/VideoDecoderChild.cpp
@@ -238,6 +238,7 @@ VideoDecoderChild::Shutdown()
SendShutdown();
}
mInitialized = false;
+ mCallback = nullptr;
}
bool
diff --git a/dom/media/ipc/VideoDecoderManagerParent.cpp b/dom/media/ipc/VideoDecoderManagerParent.cpp
index a111b5e53..4ff9acf19 100644
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -194,7 +194,7 @@ VideoDecoderManagerParent::RecvReadback(const SurfaceDescriptorGPUVideo& aSD, Su
}
RefPtr<SourceSurface> source = image->GetAsSourceSurface();
- if (!image) {
+ if (!source) {
*aResult = null_t();
return true;
}
diff --git a/dom/media/ogg/OggCodecState.cpp b/dom/media/ogg/OggCodecState.cpp
index e7e1ca4a3..d03508411 100644
--- a/dom/media/ogg/OggCodecState.cpp
+++ b/dom/media/ogg/OggCodecState.cpp
@@ -1229,12 +1229,13 @@ already_AddRefed<MediaRawData>
OpusState::PacketOutAsMediaRawData()
{
ogg_packet* packet = PacketPeek();
- uint32_t frames = 0;
- const int64_t endFrame = packet->granulepos;
-
if (!packet) {
return nullptr;
}
+
+ uint32_t frames = 0;
+ const int64_t endFrame = packet->granulepos;
+
if (packet->e_o_s) {
frames = GetOpusDeltaGP(packet);
}