From 943520382fc7e298b8a392b2dd66bad7f3961bf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 22 Jun 2013 10:59:17 +0200 Subject: [PATCH] vp8dec: Error out gracefully if we get an unsupported color format In theory we can only get I420 though, just to be on the safe side. --- ext/vpx/gstvp8dec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/vpx/gstvp8dec.c b/ext/vpx/gstvp8dec.c index 6e96efa..6ba2ce8 100644 --- a/ext/vpx/gstvp8dec.c +++ b/ext/vpx/gstvp8dec.c @@ -527,6 +527,14 @@ gst_vp8_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) img = vpx_codec_get_frame (&dec->decoder, &iter); if (img) { + if (img->fmt != VPX_IMG_FMT_I420) { + vpx_img_free (img); + GST_ELEMENT_ERROR (decoder, LIBRARY, ENCODE, + ("Failed to decode frame"), ("Unsupported color format %d", + img->fmt)); + return GST_FLOW_ERROR; + } + if (deadline < 0) { GST_LOG_OBJECT (dec, "Skipping late frame (%f s past deadline)", (double) -deadline / GST_SECOND); -- 2.7.4