From: Víctor Manuel Jáquez Leal Date: Sat, 8 Aug 2020 17:59:11 +0000 (+0200) Subject: va: h264dec: check return value of gst_va_handle_set_context() X-Git-Tag: 1.19.3~507^2~1489 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=159562faf720d67f631c47080f852cef5316e377;p=platform%2Fupstream%2Fgstreamer.git va: h264dec: check return value of gst_va_handle_set_context() Part-of: --- diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c index a99a5cb17b..1201b7256b 100644 --- a/sys/va/gstvah264dec.c +++ b/sys/va/gstvah264dec.c @@ -1300,13 +1300,16 @@ gst_va_h264_dec_set_context (GstElement * element, GstContext * context) GstVaDisplay *old_display, *new_display; GstVaH264Dec *self = GST_VA_H264_DEC (element); GstVaH264DecClass *klass = GST_VA_H264_DEC_GET_CLASS (self); + gboolean ret; old_display = self->display ? gst_object_ref (self->display) : NULL; - gst_va_handle_set_context (element, context, klass->render_device_path, + ret = gst_va_handle_set_context (element, context, klass->render_device_path, &self->display); new_display = self->display ? gst_object_ref (self->display) : NULL; - if (old_display && new_display && old_display != new_display && self->decoder) { + if (!ret + || (old_display && new_display && old_display != new_display + && self->decoder)) { GST_ELEMENT_WARNING (element, RESOURCE, BUSY, ("Can't replace VA display while operating"), (NULL)); }