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 <tom.stdenis@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Tom St Denis 2015-11-03 12:41:54 -05:00 committed by Marek Olšák
parent 6f898f740c
commit 56fc2986d5

View file

@ -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);