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
0367c050
Commit
0367c050
authored
Oct 24, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix detection of the idx1 index offset for some AVI files.
It fixes #5478.
parent
40f93137
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
modules/demux/avi/avi.c
modules/demux/avi/avi.c
+28
-10
No files found.
modules/demux/avi/avi.c
View file @
0367c050
...
...
@@ -28,6 +28,7 @@
# include "config.h"
#endif
#include <assert.h>
#include <ctype.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
...
...
@@ -2151,18 +2152,35 @@ static int AVI_IndexFind_idx1( demux_t *p_demux,
}
*
pp_idx1
=
p_idx1
;
/* *** calculate offset *** */
/* Well, avi is __SHIT__ so test more than one entry
* (needed for some avi files) */
/* The offset in the index should be from the start of the movi content,
* but some broken files use offset from the start of the file. Just
* checking the offset of the first packet is not enough as some files
* has unused chunk at the beginning of the movi content.
*/
avi_chunk_list_t
*
p_movi
=
AVI_ChunkFind
(
p_riff
,
AVIFOURCC_movi
,
0
);
*
pi_offset
=
0
;
for
(
unsigned
i
=
0
;
i
<
__MIN
(
p_idx1
->
i_entry_count
,
10
);
i
++
)
uint64_t
i_first_pos
=
UINT64_MAX
;
for
(
unsigned
i
=
0
;
i
<
__MIN
(
p_idx1
->
i_entry_count
,
100
);
i
++
)
i_first_pos
=
__MIN
(
i_first_pos
,
p_idx1
->
entry
[
i
].
i_pos
);
const
uint64_t
i_movi_content
=
p_movi
->
i_chunk_pos
+
8
;
if
(
i_first_pos
<
i_movi_content
)
{
if
(
p_idx1
->
entry
[
i
].
i_pos
<
p_movi
->
i_chunk_pos
)
{
*
pi_offset
=
p_movi
->
i_chunk_pos
+
8
;
break
;
}
*
pi_offset
=
i_movi_content
;
}
else
if
(
p_sys
->
b_seekable
&&
i_first_pos
<
UINT64_MAX
)
{
const
uint8_t
*
p_peek
;
if
(
!
stream_Seek
(
p_demux
->
s
,
i_movi_content
+
i_first_pos
)
&&
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
4
)
>=
4
&&
(
!
isdigit
(
p_peek
[
0
]
)
||
!
isdigit
(
p_peek
[
1
]
)
||
!
isalpha
(
p_peek
[
2
]
)
||
!
isalpha
(
p_peek
[
3
]
)
)
)
*
pi_offset
=
0
;
else
*
pi_offset
=
i_movi_content
;
}
else
{
*
pi_offset
=
0
;
}
return
VLC_SUCCESS
;
}
...
...
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