Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
ce718de2
Commit
ce718de2
authored
Aug 20, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore invalid blocks (on broken files).
workarounds a bug in KaxBlockVirtual implementation (close #1079).
parent
182b5b89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+34
-0
No files found.
modules/demux/mkv.cpp
View file @
ce718de2
...
...
@@ -1769,6 +1769,23 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, int64_t *pi_ref1, int64
if
(
(
el
=
ep
->
Get
())
==
NULL
&&
pp_block
!=
NULL
)
#endif
{
/* Check blocks validity to protect againts broken files */
if
(
#if LIBMATROSKA_VERSION >= 0x000800
pp_simpleblock
&&
pp_simpleblock
->
TrackNum
()
>=
tracks
.
size
()
||
#else
false
||
#endif
pp_block
&&
pp_block
->
TrackNum
()
>=
tracks
.
size
()
)
{
delete
pp_block
;
#if LIBMATROSKA_VERSION >= 0x000800
pp_simpleblock
=
NULL
;
#endif
pp_block
=
NULL
;
continue
;
}
/* update the index */
#define idx p_indexes[i_index - 1]
if
(
i_index
>
0
&&
idx
.
i_time
==
-
1
)
...
...
@@ -3843,6 +3860,19 @@ void EbmlParser::Reset( demux_t *p_demux )
mb_dummy
=
config_GetInt
(
p_demux
,
"mkv-use-dummy"
);
}
#if LIBMATROSKA_VERSION >= 0x000800
/* This function workarounds a bug in KaxBlockVirtual implementation */
class
KaxBlockVirtualWorkaround
:
public
KaxBlockVirtual
{
public:
void
Fix
()
{
if
(
Data
==
DataBlock
)
SetBuffer
(
NULL
,
0
);
}
};
#endif
EbmlElement
*
EbmlParser
::
Get
(
void
)
{
int
i_ulev
=
0
;
...
...
@@ -3864,6 +3894,10 @@ EbmlElement *EbmlParser::Get( void )
m_el
[
mi_level
]
->
SkipData
(
*
m_es
,
m_el
[
mi_level
]
->
Generic
().
Context
);
if
(
!
mb_keep
)
{
#if LIBMATROSKA_VERSION >= 0x000800
if
(
MKV_IS_ID
(
m_el
[
mi_level
],
KaxBlockVirtual
)
)
static_cast
<
KaxBlockVirtualWorkaround
*>
(
m_el
[
mi_level
])
->
Fix
();
#endif
delete
m_el
[
mi_level
];
}
mb_keep
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment