GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSize)
{
	u64 cookie = gf_bs_get_cookie(bs);
	//we allow 100 max desc in a hierarchy - see issue 2216
	if (cookie>100)
		return GF_NON_COMPLIANT_BITSTREAM;
	gf_bs_set_cookie(bs, cookie+1);
	GF_Err e = gf_odf_read_descriptor_internal(bs, desc, DescSize);
	gf_bs_set_cookie(bs, cookie);
	return e;
}
GF_Err gf_odf_read_descriptor(GF_BitStream *bs, GF_Descriptor *desc, u32 DescSize)
{
	u64 cookie = gf_bs_get_cookie(bs);
	 
	if (cookie>100)
		return GF_NON_COMPLIANT_BITSTREAM;
	gf_bs_set_cookie(bs, cookie+1);
	GF_Err e = gf_odf_read_descriptor_internal(bs, desc, DescSize);
	gf_bs_set_cookie(bs, cookie);
	return e;
}