projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18d1c75
)
libs: encoder: Add NULL pointer check for context when finalize.
author
He Junyan
<junyan.he@hotmail.com>
Sun, 22 Dec 2019 07:22:57 +0000
(15:22 +0800)
committer
He Junyan
<junyan.he@hotmail.com>
Sun, 22 Dec 2019 07:22:57 +0000
(15:22 +0800)
Context may be NULL if pipeline fail in early stage, and the
ensure_context will not be called. Need to add a pointer protection
for it.
gst-libs/gst/vaapi/gstvaapiencoder.c
patch
|
blob
|
history
diff --git
a/gst-libs/gst/vaapi/gstvaapiencoder.c
b/gst-libs/gst/vaapi/gstvaapiencoder.c
index
2d29d04
..
3f0e9a7
100644
(file)
--- a/
gst-libs/gst/vaapi/gstvaapiencoder.c
+++ b/
gst-libs/gst/vaapi/gstvaapiencoder.c
@@
-1345,7
+1345,8
@@
gst_vaapi_encoder_finalize (GObject * object)
{
GstVaapiEncoder *encoder = GST_VAAPI_ENCODER (object);
- gst_vaapi_context_unref (encoder->context);
+ if (encoder->context)
+ gst_vaapi_context_unref (encoder->context);
encoder->context = NULL;
gst_vaapi_display_replace (&encoder->display, NULL);
encoder->va_display = NULL;