mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
h265decoder: Prevent possible infinite loop
Theoretically, one could produce a broken stream that would lead to infinite in the specified algorithm to calculate l0/l1 reference lists. This patch will pearly exit if this condition is met. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1750>
This commit is contained in:
parent
2e2e93c303
commit
e3fb5f894f
1 changed files with 8 additions and 0 deletions
|
@ -376,6 +376,14 @@ gst_h265_decoder_process_ref_pic_lists (GstH265Decoder * self,
|
|||
if (GST_H265_IS_I_SLICE (&slice->header))
|
||||
return;
|
||||
|
||||
/* Inifinit loop prevention */
|
||||
if (self->NumPocStCurrBefore == 0 && self->NumPocStCurrAfter == 0 &&
|
||||
self->NumPocLtCurr == 0 && !scc_ext->pps_curr_pic_ref_enabled_flag) {
|
||||
GST_WARNING_OBJECT (self,
|
||||
"Expected references, got none, preventing infinit loop.");
|
||||
return;
|
||||
}
|
||||
|
||||
/* 8.3.4 Deriving l0 */
|
||||
tmp_refs = priv->ref_pic_list_tmp;
|
||||
|
||||
|
|
Loading…
Reference in a new issue