mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
mfc: test for allocation failure before dereferencing
Coverity 1139849
This commit is contained in:
parent
084c4d5dc4
commit
3aba455c5e
1 changed files with 1 additions and 1 deletions
|
@ -292,11 +292,11 @@ struct mfc_dec_context* mfc_dec_create(unsigned int codec)
|
||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
|
|
||||||
ctx = calloc(1, sizeof (struct mfc_dec_context));
|
ctx = calloc(1, sizeof (struct mfc_dec_context));
|
||||||
ctx->output_frames_available = 0;
|
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
GST_ERROR ("Unable to allocate memory for context");
|
GST_ERROR ("Unable to allocate memory for context");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
ctx->output_frames_available = 0;
|
||||||
|
|
||||||
if (stat (MFC_PATH, &sb) < 0) {
|
if (stat (MFC_PATH, &sb) < 0) {
|
||||||
GST_INFO ("MFC device node doesn't exist, failing quietly");
|
GST_INFO ("MFC device node doesn't exist, failing quietly");
|
||||||
|
|
Loading…
Reference in a new issue