mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
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:
parent
6f898f740c
commit
56fc2986d5
1 changed files with 3 additions and 0 deletions
|
|
@ -869,6 +869,9 @@ static void enc_ReleaseTasks(struct list_head *head)
|
||||||
{
|
{
|
||||||
struct encode_task *i, *next;
|
struct encode_task *i, *next;
|
||||||
|
|
||||||
|
if (!head)
|
||||||
|
return;
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(i, next, head, list) {
|
LIST_FOR_EACH_ENTRY_SAFE(i, next, head, list) {
|
||||||
pipe_resource_reference(&i->bitstream, NULL);
|
pipe_resource_reference(&i->bitstream, NULL);
|
||||||
i->buf->destroy(i->buf);
|
i->buf->destroy(i->buf);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue