mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
mpegtsdemux: catch prev-not-found when inserting in the group list
While this probably should never happen if callers are well behaved, this avoids a crash if it does. With a warning about it. Unsure if it'd be better to not add at all, but it should not happen... Coverity 1139713
This commit is contained in:
parent
d47727c032
commit
f255422ec2
1 changed files with 12 additions and 6 deletions
|
@ -1720,12 +1720,18 @@ _insert_group_after (MpegTSPCR * pcrtable, PCROffsetGroup * group,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toinsert = g_list_append (NULL, group);
|
if (!prevlist) {
|
||||||
toinsert->next = nextlist;
|
/* The non NULL prev given isn't in the list */
|
||||||
toinsert->prev = prevlist;
|
GST_WARNING ("Request to insert before a group which isn't in the list");
|
||||||
prevlist->next = toinsert;
|
pcrtable->groups = g_list_prepend (pcrtable->groups, group);
|
||||||
if (nextlist)
|
} else {
|
||||||
nextlist->prev = toinsert;
|
toinsert = g_list_append (NULL, group);
|
||||||
|
toinsert->next = nextlist;
|
||||||
|
toinsert->prev = prevlist;
|
||||||
|
prevlist->next = toinsert;
|
||||||
|
if (nextlist)
|
||||||
|
nextlist->prev = toinsert;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue