Module: Mesa Branch: master Commit: 56fc2986d554b93d16fa1151765a9987bc42e4da URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=56fc2986d554b93d16fa1151765a9987bc42e4da
Author: Tom St Denis <[email protected]> Date: Tue Nov 3 12:41:54 2015 -0500 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]> --- src/gallium/state_trackers/omx/vid_enc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c index aa45089..df22a97 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); _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
