v4l2sink: fix pool-less allocation query handling
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 7 Mar 2019 10:24:38 +0000 (11:24 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 8 Mar 2019 21:01:14 +0000 (22:01 +0100)
commit8b068fb78b93930ac3d35871abfd57a65ccd81f8
treefeaa5977174b4b92d8ae1cd96fd6da6ad0aa9b62
parent3f9170bd02bf9551385ce6092a2ced7fb938a874
v4l2sink: fix pool-less allocation query handling

This fixes a critical warning if the last-sample property is enabled:

  (gst-launch-1.0:391): GStreamer-CRITICAL **: 01:12:57.428: gst_object_unref: assertion 'object != NULL' failed

If the allocation query does not contain any allocation pools,
gst_query_parse_nth_allocation_pool will leave the local pool,
min, and max variables undefined, so check the array length first.
If pool is NULL, do not call gst_object_unref.
sys/v4l2/gstv4l2sink.c