From 3aba455c5e9d57ed94f45e04604c1c698d71981b Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 9 Apr 2014 10:55:46 +0100 Subject: [PATCH] mfc: test for allocation failure before dereferencing Coverity 1139849 --- sys/mfc/mfc_decoder/mfc_decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/mfc/mfc_decoder/mfc_decoder.c b/sys/mfc/mfc_decoder/mfc_decoder.c index 0e50c512a1..85fa52d2a2 100644 --- a/sys/mfc/mfc_decoder/mfc_decoder.c +++ b/sys/mfc/mfc_decoder/mfc_decoder.c @@ -292,11 +292,11 @@ struct mfc_dec_context* mfc_dec_create(unsigned int codec) pthread_mutex_unlock(&mutex); ctx = calloc(1, sizeof (struct mfc_dec_context)); - ctx->output_frames_available = 0; if (!ctx) { GST_ERROR ("Unable to allocate memory for context"); return NULL; } + ctx->output_frames_available = 0; if (stat (MFC_PATH, &sb) < 0) { GST_INFO ("MFC device node doesn't exist, failing quietly");