Don't crash on buffer alloc failure
authorJussi Saavalainen <jussi.saavalainen@ixonos.com>
Tue, 23 Apr 2013 14:42:17 +0000 (17:42 +0300)
committerTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Thu, 25 Apr 2013 08:14:19 +0000 (11:14 +0300)
Change-Id: I07efe0b57f8830e225370c5cdd33d758750b5c92

gst/mfldv4l2cam/v4l2camsrc_calls.c

index 1404b4f..b59eca6 100644 (file)
@@ -531,9 +531,9 @@ gst_v4l2camsrc_buffer_pool_new (GstMFLDV4l2CamSrc *v4l2camsrc, gint fd,
     pool->buffers[n] = gst_v4l2camsrc_buffer_new (
                            pool, v4l2camsrc, n, caps,
                            use_mmap, is_second, frame_byte_size, pad);
-    GST_LOG ("buffer ref is %d", GST_MINI_OBJECT_REFCOUNT (pool->buffers[n]));
     if (!pool->buffers[n])
       goto buffer_new_failed;
+    GST_LOG ("buffer ref is %d", GST_MINI_OBJECT_REFCOUNT (pool->buffers[n]));
   }
 
   return pool;