Commit Graph

20 Commits

Author SHA1 Message Date
James Zern
a97c484bfd Merge "disable -Wdeprecated-declarations in legacy code" 2017-06-22 02:02:16 +00:00
James Zern
90967863b2 mkvparser: fix float conversion warning
Change-Id: I2b79a6af431f9c51e5c32c75da18645674ebbb4d
2017-06-20 19:20:01 -07:00
James Zern
84e82579f7 disable -Wdeprecated-declarations in legacy code
this avoids downstream projects from needing to add this flag to their
build.

BUG=webm:1445

Change-Id: I03f3cc20496bc52245b6c3c013ae3c13936f4b4f
2017-06-20 19:18:42 -07:00
James Zern
300d6d8719 CuePoint::Find: check Track pointer
replace assert with a check of the pointer, this is a public function so
should be tolerant of invalid parameters

BUG=webm:1415

Change-Id: I28a3a2ef905d62f11928dbbe54c119411d2b1f74
2017-04-19 23:24:27 -07:00
James Zern
a0d27f0d51 mkvparser,Block::Parse: remove incorrect assert
this path has been error checked since:
986b64b mkvparser: Add error checking in Block::Parse.

BUG=webm:1405

Change-Id: I1c17c05076455f25ab888555d71d7b27c032e9dd
2017-04-18 12:45:43 -07:00
James Zern
2cef4d51a2 mkvparser:Parse: s/FLT_MIN/-FLT_MAX/
FLT_MIN is the smallest finite value (numeric_limits::min()) -FLT_MAX is
the correct for the most negative (numeric_limits::lowest())

http://en.cppreference.com/w/cpp/types/numeric_limits

BUG=b/36255773
BUG=webm:1381

Change-Id: Iaaff611acffc3df28fef12af81ac5299791f0148
2017-03-23 16:27:41 -07:00
Tom Finegan
5a418303e3 mkvparser: Avoid double free when Chromaticity parse fails.
PrimaryChromaticity::Parse never owns the PrimaryChromaticity
it allocates-- avoid freeing it because doing so results in a
double free when the MasteringMetadata dtor runs.

BUG=webm:1381

Change-Id: Ief0159f6ab667234e3fdc51c65f23ef5efb32a71
2017-03-21 10:44:09 -07:00
Tom Finegan
67e3ffa908 mkvparser: Avoid casts of values too large for float in Projection elements.
Return a parse error when values are out of range.

BUG=b/36255773

Change-Id: I977c41c9108b97592f3707bf8c01373cf36f2365
2017-03-20 14:03:19 -07:00
Tom Finegan
81c73fc78e mkvparser: Avoid alloc failures in SeekHead::Parse.
Some run times return NULL pointers when creating 0 length
arrays. Avoid the inconsistency by skipping allocation when
the length of the SeekHead entry or void element array
is 0.

BUG=webm:1313

Change-Id: I28b4eac1d3e0ba968147637883f6e37c089e8573
2016-10-31 12:11:56 -07:00
James Zern
6db32d5f6e mkvparser,Projection::Parse: fix int->bool conv
this would have incorrectly returned true on parse failure

Change-Id: I1ae6fc2aae09491aa3cda47a5414529fc7a3848f
2016-10-17 23:34:06 -07:00
James Zern
0e179d683e update .clang-format
generated by version 3.8.1
local changes from --style=Google

3a4
> # Generated with clang-format 3.8.1
10c11
< AlignTrailingComments: true
---
> AlignTrailingComments: false
15,16c16,17
< AllowShortIfStatementsOnASingleLine: true
< AllowShortLoopsOnASingleLine: true
---
> AllowShortIfStatementsOnASingleLine: false
> AllowShortLoopsOnASingleLine: false
37c38
< BreakBeforeTernaryOperators: true
---
> BreakBeforeTernaryOperators: false

Change-Id: I4ded7e36fb8bd5407cfba6d1c4f86e0bec620c0c
2016-10-17 15:41:56 -07:00
Tom Finegan
826436a42f mkvparser: minor SeekHead::Entry clean up.
- Store actual element ID in SeekHead::Entry id field (instead
  of a decoded EBML int, which is completely _wrong_).
- Add a SeekHead::Entry constructor so we get initialized values
  in SeekHead::Entry's when parsing an Entry fails.

Change-Id: I152fae54628cb84918917139dba0cd0b42a44a57
2016-08-31 10:00:04 -07:00
Tom Finegan
41e814a008 mkvparser: Add Projection element support.
Part of the Spherical Video V2 draft specification:
https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md

Change-Id: I431349898b4018189cc58ce2cd67158ffb4c7f80
2016-08-29 14:29:30 -07:00
Tom Finegan
4b0690faa2 parser_tests: Add invalid lacing test.
Also fixes leak this test exposed in mkvparser::Cluster.

Change-Id: I06ae11b72bc89219b6b2b407b4cc215982e3ae65
2016-08-19 11:57:05 -07:00
Tom Finegan
ef464c2a95 mkvparser: Fix implicit conversion warnings.
Fix warnings exposed by addition of compiler flag
-Wshorten-64-to-32.

Change-Id: I9adcfa97babbda1a5d94fe06ec84eab69eb8d842
2016-04-08 09:23:35 -07:00
Tom Finegan
1f2432397f msvc/hdr_util: Silence double to float conversion warnings.
- Use float instead of double for Colour children in mkvparser.
- Add casts where appropriate.

Change-Id: Ia0f7e4dc25536cd43bc5e9439c58770dc3d79bc5
2016-03-31 10:43:05 -07:00
Tom Finegan
da6439685d cmake/msvc: Disable C4996 project wide.
MSVC C4996 triggers upon use of functions like fopen, and suggests
use of non-portable Microsoft replacements. Disable it project wide,
and remove the pragmas littered throughout the tree.

Change-Id: I8b890bbfd3cd7224c25350bd28f334facd8b7783
2016-03-30 12:32:22 -07:00
James Zern
3fa6aecb7f mkvparser::BlockEntry: inline EOS()
Change-Id: I1cd5ef4e438a285c733c9246411513f670c2c9c4
2016-03-29 16:55:42 -07:00
Tom Finegan
cbe5c40d12 Restore original namespaces for mkvmuxer and mkvparser.
Wrapping mkvmuxer and mkvparser in the libwebm namespace is no
longer necessary now that the tree reorganization is complete.
Put mkvmuxer and mkvparser namespaces back in the global
namespace to avoid unnecessary churn in downstream code.

Change-Id: I13a4fe0143d20bb2bb6038078c68636ff2af0c29
2016-03-21 14:41:49 -07:00
Tom Finegan
504e0f2d5b Mass file extension update.
- Use .cc and .h everywhere.
- Update includes/include guards.
- Remove extra makefile targets necessitated by previous mix
  of cpp/cc.

Change-Id: I7aad29152d4177937f8f42927c16c6572228c104
2016-03-21 14:41:47 -07:00