diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c b/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c index 5b6cbe67a1..9404f2b394 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c @@ -300,7 +300,11 @@ _create_internal_pool (GstVaAV1Dec * self, gint width, gint height) return NULL; } - gst_buffer_pool_set_active (pool, TRUE); + if (!gst_buffer_pool_set_active (pool, TRUE)) { + GST_WARNING_OBJECT (self, "Failed to activate internal pool"); + gst_object_unref (pool); + return NULL; + } return pool; } diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c index 2cadb5d497..56f73db11a 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c @@ -229,7 +229,10 @@ _get_sinkpad_pool (GstVaBaseEnc * base) gst_object_unref (allocator); - gst_buffer_pool_set_active (base->priv->raw_pool, TRUE); + if (!gst_buffer_pool_set_active (base->priv->raw_pool, TRUE)) { + GST_WARNING_OBJECT (base, "Failed to activate sinkpad pool"); + return NULL; + } return base->priv->raw_pool; } @@ -690,8 +693,10 @@ error_reorder: { GST_ELEMENT_ERROR (venc, STREAM, ENCODE, ("Failed to reorder the input frame."), (NULL)); - gst_clear_buffer (&frame->output_buffer); - gst_video_encoder_finish_frame (venc, frame); + if (frame) { + gst_clear_buffer (&frame->output_buffer); + gst_video_encoder_finish_frame (venc, frame); + } return GST_FLOW_ERROR; } error_encode: diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c b/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c index 5ced2fa104..fbc72300af 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c @@ -768,7 +768,10 @@ _get_sinkpad_pool (GstVaBaseTransform * self) if (self->priv->sinkpad_caps) { caps = self->priv->sinkpad_caps; - gst_video_info_from_caps (&in_info, caps); + if (!gst_video_info_from_caps (&in_info, caps)) { + GST_ERROR_OBJECT (self, "Cannot parse caps %" GST_PTR_FORMAT, caps); + return NULL; + } } else { caps = self->in_caps; in_info = self->in_info; diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c index 9e08df713e..fa8d64eaa1 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaencoder.c @@ -397,7 +397,11 @@ gst_va_encoder_open (GstVaEncoder * self, VAProfile profile, GST_ERROR_OBJECT (self, "Failed to create reconstruct pool"); goto error; } - gst_buffer_pool_set_active (recon_pool, TRUE); + + if (!gst_buffer_pool_set_active (recon_pool, TRUE)) { + GST_ERROR_OBJECT (self, "Failed to activate reconstruct pool"); + goto error; + } status = vaCreateContext (dpy, config, coded_width, coded_height, VA_PROGRESSIVE, NULL, 0, &context); diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c b/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c index 5e57d4482e..1072e256d4 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c @@ -1200,11 +1200,13 @@ _calculate_coded_size (GstVaH264Enc * self) BitDepthC = 10; MbWidthC = 8; MbHeightC = 8; + break; case VA_RT_FORMAT_YUV422_10: BitDepthY = 10; BitDepthC = 10; MbWidthC = 8; MbHeightC = 16; + break; case VA_RT_FORMAT_YUV444_10: BitDepthY = 10; BitDepthC = 10;