From 5c6f79720b5afde9a50fda7a8adb57500aba539d Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Tue, 18 Aug 2015 12:34:15 +1200 Subject: [PATCH] Bug 1195058 - Handle pa_context_new returning NULL in OOM situations. r=padenot --- media/libcubeb/src/cubeb_pulse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/media/libcubeb/src/cubeb_pulse.c b/media/libcubeb/src/cubeb_pulse.c index b9456c57d6f..c1ac2fb21c2 100644 --- a/media/libcubeb/src/cubeb_pulse.c +++ b/media/libcubeb/src/cubeb_pulse.c @@ -318,6 +318,9 @@ pulse_context_init(cubeb * ctx) ctx->context = WRAP(pa_context_new)(WRAP(pa_threaded_mainloop_get_api)(ctx->mainloop), ctx->context_name); + if (!ctx->context) { + return -1; + } WRAP(pa_context_set_state_callback)(ctx->context, context_state_callback, ctx); WRAP(pa_threaded_mainloop_lock)(ctx->mainloop);