From da2772235199924e61cc588ceb81e6bc420f0adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 7 May 2021 16:02:04 +0200 Subject: [PATCH] libs: codecs: h264decoder: Assert output_picture virtual method. For new code it's nice to assert if the derived class implemented the output_picture virtual method. Otherwise a segmentation fault occurs. All other decoders assert this method. Part-of: --- gst-libs/gst/codecs/gsth264decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c index 1ee6f54de1..554ab1e03a 100644 --- a/gst-libs/gst/codecs/gsth264decoder.c +++ b/gst-libs/gst/codecs/gsth264decoder.c @@ -1525,6 +1525,8 @@ gst_h264_decoder_drain_output_queue (GstH264Decoder * self, guint num) GstH264DecoderPrivate *priv = self->priv; GstH264DecoderClass *klass = GST_H264_DECODER_GET_CLASS (self); + g_assert (klass->output_picture); + while (gst_queue_array_get_length (priv->output_queue) > num) { GstH264DecoderOutputFrame *output_frame = (GstH264DecoderOutputFrame *) gst_queue_array_pop_head_struct (priv->output_queue);