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
a0009754
Commit
a0009754
authored
Dec 16, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thp: simplify overallocate checks.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
47572323
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
thp.c
libavformat/thp.c
+3
-13
No files found.
libavformat/thp.c
View file @
a0009754
...
...
@@ -26,7 +26,6 @@
typedef
struct
ThpDemuxContext
{
int
version
;
unsigned
data_size
;
int
first_frame
;
int
first_framesz
;
int
last_frame
;
...
...
@@ -74,9 +73,9 @@ static int thp_read_header(AVFormatContext *s,
thp
->
fps
=
av_d2q
(
av_int2float
(
avio_rb32
(
pb
)),
INT_MAX
);
thp
->
framecnt
=
avio_rb32
(
pb
);
thp
->
first_framesz
=
avio_rb32
(
pb
);
thp
->
data_size
=
avio_rb32
(
pb
);
if
(
fsize
>
0
&&
(
!
thp
->
data_size
||
fsize
<
thp
->
data_
size
))
thp
->
data_
size
=
fsize
;
pb
->
maxsize
=
avio_rb32
(
pb
);
if
(
fsize
>
0
&&
(
!
pb
->
maxsize
||
fsize
<
pb
->
max
size
))
pb
->
max
size
=
fsize
;
thp
->
compoff
=
avio_rb32
(
pb
);
avio_rb32
(
pb
);
/* offsetDataOffset. */
...
...
@@ -163,10 +162,6 @@ static int thp_read_packet(AVFormatContext *s,
avio_rb32
(
pb
);
/* Previous total size. */
size
=
avio_rb32
(
pb
);
/* Total size of this frame. */
if
(
thp
->
data_size
&&
avio_tell
(
pb
)
+
size
>
thp
->
data_size
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Video packet truncated
\n
"
);
size
=
thp
->
data_size
-
avio_tell
(
pb
);
}
/* Store the audiosize so the next time this function is called,
the audio can be read. */
...
...
@@ -183,11 +178,6 @@ static int thp_read_packet(AVFormatContext *s,
pkt
->
stream_index
=
thp
->
video_stream_index
;
}
else
{
if
(
thp
->
data_size
&&
avio_tell
(
pb
)
+
thp
->
audiosize
>
thp
->
data_size
){
av_log
(
s
,
AV_LOG_ERROR
,
"Audio packet truncated
\n
"
);
thp
->
audiosize
=
thp
->
data_size
-
avio_tell
(
pb
);
}
ret
=
av_get_packet
(
pb
,
pkt
,
thp
->
audiosize
);
if
(
ret
!=
thp
->
audiosize
)
{
av_free_packet
(
pkt
);
...
...
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