Skip to content

BitReader throw exception when input is exhausted.#384

Open
avrecko wants to merge 1 commit into
jcodec:masterfrom
avrecko:bitreader_exception_on_eof
Open

BitReader throw exception when input is exhausted.#384
avrecko wants to merge 1 commit into
jcodec:masterfrom
avrecko:bitreader_exception_on_eof

Conversation

@avrecko

@avrecko avrecko commented Aug 15, 2019

Copy link
Copy Markdown

It happened that on some bad data we get in infinite loop inside the SliceHeaderReader#readReorderingEntries method.

I've made it possible to supply a BitReader that throws exception when input is exhausted. This way if an infinite loop happens the BitReader#readInt() will eventually throw IllegalStateException instead of returning 0 and looping forever.

I need extra safety also for H264 Sps and Pps that is why I added read methods that take BitReader as an argument.

To prevent infinite loop on bad h264 data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant