planaraudioadapter: fix possible NULL ptr dereference
authorAndrey Sazonov <andrey.sazonov@intel.com>
Thu, 21 May 2020 14:28:38 +0000 (14:28 +0000)
committerAndrey Sazonov <andrey.sazonov@intel.com>
Thu, 21 May 2020 17:12:25 +0000 (17:12 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1288>

gst-libs/gst/audio/gstplanaraudioadapter.c

index 758c1c925a72e130a76d7ff81134ac0c5f7ee8b5..1a843da3a1578d766fc5f5f3d59c390c8a351122 100644 (file)
@@ -404,8 +404,7 @@ gst_planar_audio_adapter_get_buffer (GstPlanarAudioAdapter * adapter,
       gsize cur_skip = skip;
       gsize take_from_cur;
       GSList *cur_node = adapter->buflist;
-
-      while (need > 0) {
+      while (cur_node && need > 0) {
         cur = cur_node->data;
         meta = gst_buffer_get_audio_meta (cur);
         take_from_cur = need > (meta->samples - cur_skip) ?