some unchecked new's are left in a few void functions, they'll be
addressed in a separate commit
BUG=23430793
Change-Id: I4953e70f4e7b0401a293c6b87c02445960e9ff9e
with -funsigned-char the sign will be flipped, e.g., -128 -> 128, use an
explicit signed char.
additionally drop the misguided range check; this is meant as a data
size limit not one for the big-endian encoded ints
Change-Id: Ia10ef811d16acd09cbcd3d95856d9c460c9b7f16
Remove asserts in sections recently updated to do error checking, and
replace some additional nearby asserts with error checks.
Change-Id: Ia8b60824736a7a821bbca3f2bfef5de4bb584c2d
- Not strictly rollover-- avoid exceeding max 64 EBML (2^26 - 2).
- Tidy up the function.
BUG=23321923
Change-Id: I172c75064c189ed0fcf224145d016fca421f60c6
libwebm cannot handle a duration in seconds greater than LONG_LONG_MAX
because it stores the values in long long variables.
BUG=23321923
Change-Id: Idb73f04a73e35829ae34386ea6c388fd355dd102
Confirm asserted conditions are as expected in all build
configurations, and avoid rolling over pos in obvious places.
BUG=23225325
Change-Id: I8af3192283788fd4a4b5b8ba4ad94abeab7feff2
Instead of relying solely on asserts, which compile away to
nothing in downstream projects using libwebm for parsing webm
input streams, actually check for the conditions being asserted,
and return errors when appropriate.
Change-Id: Id8b6352e8dda69782129dcea8f67203fd9c4f572
Re-run clang-format to pick up some missed changes over the past
few CLs. Also update the .clang-format file to break after ternary
operator.
Change-Id: Ia4ba4e58362c2dbe36aeb33894f0411af33ef17d
Fix EBML lacing block parsing when attempting to parse the last frame
on single-frame videos and assertion when frame_count is lower
than actual data in the file.
Change-Id: I223e30be54970ef75126c6c4ee3401cbeb92e02f
Fixed block parsing to account to cases that would
allow frame_size = 0, only to be rejected later on
Block::GetFrame assert(f.len > 0);
Change-Id: Idb93388b37e1963ec6115ac49f15e4951bc2c724
Malformed files woudl cause the parser to assert.
Instead now it stops parsing and skips the segment.
Change-Id: I256b3b72e43f969693ae16547ca98da07d665e21
Changed assertions to "invalid file format" errors files that
had Block Groups without Block IDs or had invalid sizes or
durations
Change-Id: I1383a63bfb76ee46aaa0aff089780383ce65fc31
Malformed files would cause the parser to assert.
Instead now it stops parsing and skips the segment.
Change-Id: I07e3baf5c9eb6feb115e155f226d8abc2c37698e
If a malformed webm file contains invalid information on the Cues
the segment, the parser would assert.
Instead, now it ignores the Cues and skips the segment.
Change-Id: I9270f6a0935ce9e9a3765a5f324ae542c1ade1c7
previously only empty clusters of known size were accepted; with
clusters of unknown size the cluster has been successfully parsed and a
working copy of the file position updated, so parsing can continue.
clusters of this type are discarded as clusters of known size currently
are.
Change-Id: I3ef848768519ab7f1887a11629c50af72249cead
the element length was being read twice; the second attempt would
consume a portion of the discard padding field often failing due to
limitations in GetUIntLength.
Change-Id: Ibbe3f082e2d05460734a0e1f7d23f3c665e3f24b
mkvparser::UnserializeUInt() assumes that unsigned values never have
their high bit set. This is too limiting for UUIDs. In addition, the
Chapters::Atom::Parse() method would truncate a "negative" 64-bit UUID
value to 32 bits and return the truncated value as a status code.
This value then might or might not be treated as an error by the caller
depending on whether the truncated value was itself negative.
Change-Id: I15624ac62d0b02691a1405ee6a5f7eb441b3bc48