Commit graph

4 commits

Author SHA1 Message Date
Danil Chapovalov
cd8b36bb9f Fix integer underflow in H264 bitstream parser
num_ref are represented using golomb and may be very large.
BitstreamReader is generally resilent to many consenquites fail reads, but not when number of reads comparable to int limit.
This change address the issue in two ways, either one is enough, but both are helpful in their own way:

H264 parser now fails faster when number of references is too large.
BitstreamReader now is resilent to unlimited number of fail reads.

Bug: chromium:352402499
Change-Id: I19646bc3f53cd2970393d00bc143400b1fdf5473
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357100
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42628}
2024-07-12 15:01:55 +00:00
philipel
579a7b498c Add OptionalBlobEncoder for RTC event logs.
Bug: webrtc:14801
Change-Id: I7c14597e39b312c26573f034dca444cc1d90e332
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295480
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39449}
2023-03-02 12:02:07 +00:00
Danil Chapovalov
1ce585953c Fix integer underflow in BitstreamReader::ConsumeBits
Unlike ReadBits, ConsumeBits doesn't limit number of bits it may advance,
and thus should work when that number is close to the integer limit

Bug: chromium:1250730
Change-Id: Ia7847869ef9d3fc16450d572c9e2be6e1aa36741
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232332
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35042}
2021-09-20 19:37:49 +00:00
Danil Chapovalov
5af152c214 Inroduce BitstreamReader class to parse sequences of bits
With intent to replace BitBuffer.
This version is optimised for binary size and readability of the parsers
at the cost of slower parsing of invalid bitstreams

Bug: None
Change-Id: Ib054e2a7758b9a69cbf2559e739465b104a7dcf3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230244
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34886}
2021-08-31 15:08:49 +00:00