summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-02-16 12:35:09 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-02-16 12:35:09 +0200
commit0c9f35653f77e1cab32e7014a32e3c8f7fa8bbeb (patch)
treead16fe12ba43bc1174cec00570af8564517d1bf2
parent282dbcee0b7479a754c839b081e59eddf6e9841a (diff)
vtenc: Check if VTSessionCopyProperty() succeeds before using the result
https://bugzilla.gnome.org/show_bug.cgi?id=744585
-rw-r--r--sys/applemedia/vtenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c
index 94bc32d4b..ef18784cc 100644
--- a/sys/applemedia/vtenc.c
+++ b/sys/applemedia/vtenc.c
@@ -1014,6 +1014,11 @@ gst_vtenc_update_latency (GstVTEnc * self)
status = VTSessionCopyProperty (self->session,
kVTCompressionPropertyKey_NumberOfPendingFrames, NULL, &value);
+ if (status != noErr || !value) {
+ GST_INFO_OBJECT (self, "failed to get NumberOfPendingFrames: %d", status);
+ return;
+ }
+
CFNumberGetValue (value, kCFNumberSInt32Type, &frames);
if (self->latency_frames == -1 || self->latency_frames != frames) {
self->latency_frames = frames;