st/omx/enc: check uninitialized list from task release
authorLeo Liu <leo.liu@amd.com>
Mon, 11 Jul 2016 19:27:16 +0000 (15:27 -0400)
committerLeo Liu <leo.liu@amd.com>
Fri, 15 Jul 2016 13:17:36 +0000 (09:17 -0400)
The uninitialized list should be checked and returned.

Thank Julien for the notification and suggested fix.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/omx/vid_enc.c

index bbc7941ffe0a3b82aa216394746e9b749942a90a..642238e53f00303a77edcd0e7f2b64c4cc49b208 100644 (file)
@@ -874,8 +874,8 @@ static void enc_ReleaseTasks(struct list_head *head)
 {
    struct encode_task *i, *next;
 
-   if (!head)
-          return;
+   if (!head || !head->next)
+      return;
 
    LIST_FOR_EACH_ENTRY_SAFE(i, next, head, list) {
       pipe_resource_reference(&i->bitstream, NULL);