amcvideodec: guard against not finding a valid frame in loop
authorMatthew Waters <matthew@centricular.com>
Fri, 29 Jan 2016 12:28:59 +0000 (23:28 +1100)
committerMatthew Waters <matthew@centricular.com>
Fri, 29 Jan 2016 12:52:15 +0000 (23:52 +1100)
Fixes sporadic crashes on finishing decoding a video.

https://bugzilla.gnome.org/show_bug.cgi?id=761014

sys/androidmedia/gstamcvideodec.c

index 49808f9bf301a058c2f292276ed635c36bac14c9..36b547a86952865a7c4d14c084eb4c1e1e8aface 100644 (file)
@@ -1300,7 +1300,7 @@ retry:
         "Frame is too late, dropping (deadline %" GST_STIME_FORMAT ")",
         GST_STIME_ARGS (deadline));
     flow_ret = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
-  } else if (self->codec_config == AMC_CODEC_CONFIG_WITH_SURFACE) {
+  } else if (frame && self->codec_config == AMC_CODEC_CONFIG_WITH_SURFACE) {
     GstBuffer *outbuf;
     GstGLSyncMeta *sync_meta;
     GstVideoCodecState *state;