Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at https://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: https://gpac.io/bug-reporting/

I make daisy-chain like below picture  
![image](https://github.com/gpac/gpac/assets/80387186/2ff8f5ed-a56c-46a0-b6c4-a6efddd62b09)  

```
// Setting subsegs_per_sidx = 2 ,  Bool daisy_chain_sidx = GF_TRUE
err = gf_isom_close_segment(file_ptr, 2, track_id, (TIMESCALE/FPS)*box_offset, 0, 0, GF_TRUE, GF_FALSE, GF_FALSE, GF_FALSE, 0, 0, 0, NULL);
```

refer to `ISO_IEC_14496_12_2022 | J.2.3 Daisy-chain `   
I want to share Pictures but, Because of copyright, I will explain in writing.  

After close the segment  
Result of `referenced_size` value :   
`referenced_size` of sidx 0 : 1016806 (mdat size : 1016706 moof size : 100) --> correct  
<img width="956" alt="1111_sidx" src="https://github.com/gpac/gpac/assets/80387186/b58d542d-defa-451c-b084-543806a6a35e">  

but `referenced_size` of sidx 1 : 983529  (mdat size : 983385 moof size : 100 sidx size :44) --> wrong  
Expected result of `referenced_size` of sidx 1 value : 44   (According to ISO_IEC_14496_12_2022   
J.2.3 Daisy-chain)
<img width="956" alt="2222_sidx" src="https://github.com/gpac/gpac/assets/80387186/949e33e9-8798-4ce6-ac14-2001e9e7f98b">  

Do I use wrong Or Is the library itself doing the calculation wrong???
daisy-chain in sidx box, reference_size value 
This is a GitHub Issue
repo:gpac
owner:gpac
Title : daisy-chain in sidx box, reference_size value 
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at https://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: https://gpac.io/bug-reporting/

I make daisy-chain like below picture  
![image](https://github.com/gpac/gpac/assets/80387186/2ff8f5ed-a56c-46a0-b6c4-a6efddd62b09)  

```
// Setting subsegs_per_sidx = 2 ,  Bool daisy_chain_sidx = GF_TRUE
err = gf_isom_close_segment(file_ptr, 2, track_id, (TIMESCALE/FPS)*box_offset, 0, 0, GF_TRUE, GF_FALSE, GF_FALSE, GF_FALSE, 0, 0, 0, NULL);
```

refer to `ISO_IEC_14496_12_2022 | J.2.3 Daisy-chain `   
I want to share Pictures but, Because of copyright, I will explain in writing.  

After close the segment  
Result of `referenced_size` value :   
`referenced_size` of sidx 0 : 1016806 (mdat size : 1016706 moof size : 100) --> correct  
<img width="956" alt="1111_sidx" src="https://github.com/gpac/gpac/assets/80387186/b58d542d-defa-451c-b084-543806a6a35e">  

but `referenced_size` of sidx 1 : 983529  (mdat size : 983385 moof size : 100 sidx size :44) --> wrong  
Expected result of `referenced_size` of sidx 1 value : 44   (According to ISO_IEC_14496_12_2022   
J.2.3 Daisy-chain)
<img width="956" alt="2222_sidx" src="https://github.com/gpac/gpac/assets/80387186/949e33e9-8798-4ce6-ac14-2001e9e7f98b">  

Do I use wrong Or Is the library itself doing the calculation wrong???
--- end body ---
