aizvorski / h264bitstream

A complete set of functions to read and write H.264 video bitstreams, in particular to examine or modify headers.
GNU Lesser General Public License v2.1
713 stars 237 forks source link

avcc->pps_table is initialised using the SPS count instead of the PPS count #57

Open yannlandry opened 3 weeks ago

yannlandry commented 3 weeks ago

At line 51 in read_avcc(), avcc->pps_table is initialised using avcc->numOfSequenceParameterSets where it should probably be using avcc->numOfPictureParameterSets. Otherwise, there could be an out-of-bound situation if the number of PPS is greater than the number of SPS.

https://github.com/aizvorski/h264bitstream/blob/ae72f7395f328876199a7e928d3b4a6dc6a7ce14/h264_avcc.c#L51

aizvorski commented 3 weeks ago

Well spotted! Mind submitting a PR with a patch? Would be an instant-merge ;)