omxvideoenc: prevent a NULL pointer access
authorJosep Torra <n770galaxy@gmail.com>
Wed, 27 Feb 2013 09:21:39 +0000 (10:21 +0100)
committerJosep Torra <n770galaxy@gmail.com>
Wed, 27 Feb 2013 09:21:39 +0000 (10:21 +0100)
omx/gstomxvideoenc.c

index 967ccac..4a4faa4 100644 (file)
@@ -601,6 +601,13 @@ _find_nearest_frame (GstOMXVideoEnc * self, GstOMXBuffer * buf)
       BufferIdentification *id = gst_video_codec_frame_get_user_data (tmp);
       guint64 diff_ticks, diff_frames;
 
+      /* This happens for frames that were just added but
+       * which were not passed to the component yet. Ignore
+       * them here!
+       */
+      if (!id)
+        continue;
+
       if (id->timestamp > best_timestamp)
         break;