Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8d0da20c
Commit
8d0da20c
authored
Mar 19, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avidec: fix duration and bitrate of truncated files
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4d16ba2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
avidec.c
libavformat/avidec.c
+8
-2
No files found.
libavformat/avidec.c
View file @
8d0da20c
...
@@ -62,6 +62,7 @@ typedef struct {
...
@@ -62,6 +62,7 @@ typedef struct {
int64_t
riff_end
;
int64_t
riff_end
;
int64_t
movi_end
;
int64_t
movi_end
;
int64_t
fsize
;
int64_t
fsize
;
int64_t
io_fsize
;
int64_t
movi_list
;
int64_t
movi_list
;
int64_t
last_pkt_pos
;
int64_t
last_pkt_pos
;
int
index_loaded
;
int
index_loaded
;
...
@@ -373,7 +374,7 @@ static int avi_read_header(AVFormatContext *s)
...
@@ -373,7 +374,7 @@ static int avi_read_header(AVFormatContext *s)
av_log
(
avi
,
AV_LOG_DEBUG
,
"use odml:%d
\n
"
,
avi
->
use_odml
);
av_log
(
avi
,
AV_LOG_DEBUG
,
"use odml:%d
\n
"
,
avi
->
use_odml
);
avi
->
fsize
=
avio_size
(
pb
);
avi
->
io_fsize
=
avi
->
fsize
=
avio_size
(
pb
);
if
(
avi
->
fsize
<=
0
||
avi
->
fsize
<
avi
->
riff_end
)
if
(
avi
->
fsize
<=
0
||
avi
->
fsize
<
avi
->
riff_end
)
avi
->
fsize
=
avi
->
riff_end
==
8
?
INT64_MAX
:
avi
->
riff_end
;
avi
->
fsize
=
avi
->
riff_end
==
8
?
INT64_MAX
:
avi
->
riff_end
;
...
@@ -569,8 +570,13 @@ static int avi_read_header(AVFormatContext *s)
...
@@ -569,8 +570,13 @@ static int avi_read_header(AVFormatContext *s)
default:
default:
av_log
(
s
,
AV_LOG_INFO
,
"unknown stream type %X
\n
"
,
tag1
);
av_log
(
s
,
AV_LOG_INFO
,
"unknown stream type %X
\n
"
,
tag1
);
}
}
if
(
ast
->
sample_size
==
0
)
if
(
ast
->
sample_size
==
0
)
{
st
->
duration
=
st
->
nb_frames
;
st
->
duration
=
st
->
nb_frames
;
if
(
st
->
duration
>
0
&&
avi
->
io_fsize
>
0
&&
avi
->
riff_end
>
avi
->
io_fsize
)
{
av_log
(
s
,
AV_LOG_DEBUG
,
"File is truncated adjusting duration
\n
"
);
st
->
duration
=
av_rescale
(
st
->
duration
,
avi
->
io_fsize
,
avi
->
riff_end
);
}
}
ast
->
frame_offset
=
ast
->
cum_len
;
ast
->
frame_offset
=
ast
->
cum_len
;
avio_skip
(
pb
,
size
-
12
*
4
);
avio_skip
(
pb
,
size
-
12
*
4
);
break
;
break
;
...
...
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