diff options
author | Tom St Denis <[email protected]> | 2015-11-03 12:41:54 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-01-12 19:13:19 +0100 |
commit | 56fc2986d554b93d16fa1151765a9987bc42e4da (patch) | |
tree | 3a53152d2ff3918dd22f5ecfc98f2a65172683de /src/gallium | |
parent | 6f898f740c4932f3d34f5f69d60b9b9b6b3a9327 (diff) |
st/omx: Avoid segfault in deconstructor if constructor fails
If the constructor fails before the LIST_INIT calls the pointers
will be null and the deconstructor will segfault.
Signed-off-by: Tom St Denis <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/omx/vid_enc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c index aa45089ae04..df22a97a42c 100644 --- a/src/gallium/state_trackers/omx/vid_enc.c +++ b/src/gallium/state_trackers/omx/vid_enc.c @@ -869,6 +869,9 @@ static void enc_ReleaseTasks(struct list_head *head) { struct encode_task *i, *next; + if (!head) + return; + LIST_FOR_EACH_ENTRY_SAFE(i, next, head, list) { pipe_resource_reference(&i->bitstream, NULL); i->buf->destroy(i->buf); |