blob: e2fe02ccf320d881d6f572c9e1b9112327a94a9c (
plain)
1 Description: Fix a crash if a heap is destroyed before being initialized
2 Author: Sebastian Ramacher <sramacher@debian.org>
3 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=58836
4 Bug-Debian: http://bugs.debian.org/748294
5 Last-Update: 2014-06-02
6
7 --- vdpau-video-0.7.4.orig/src/object_heap.c
8 +++ vdpau-video-0.7.4/src/object_heap.c
9 @@ -272,8 +272,10 @@ object_heap_destroy(object_heap_p heap)
10 ASSERT(obj->next_free != ALLOCATED);
11 }
12
13 - for (i = 0; i < heap->heap_size / heap->heap_increment; i++) {
14 - free(heap->bucket[i]);
15 + if (heap->bucket) {
16 + for (i = 0; i < heap->heap_size / heap->heap_increment; i++) {
17 + free(heap->bucket[i]);
18 + }
19 }
20
21 pthread_mutex_destroy(&heap->mutex);
|