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
b08a7425
Commit
b08a7425
authored
Dec 19, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
siff: simplify code by using ffio_limit()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1dcce49e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
siff.c
libavformat/siff.c
+6
-7
No files found.
libavformat/siff.c
View file @
b08a7425
...
...
@@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
enum
SIFFTags
{
TAG_SIFF
=
MKTAG
(
'S'
,
'I'
,
'F'
,
'F'
),
...
...
@@ -201,18 +202,16 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if
(
!
c
->
curstrm
){
int64_t
fsize
=
avio_size
(
s
->
pb
);
size
=
c
->
pktsize
-
c
->
sndsize
;
if
(
fsize
>
0
)
size
=
FFMIN
(
size
,
fsize
-
avio_tell
(
s
->
pb
)
+
c
->
gmcsize
+
3
);
if
(
size
<
2
+
c
->
gmcsize
||
c
->
pktsize
<
c
->
sndsize
)
size
=
c
->
pktsize
-
c
->
sndsize
-
c
->
gmcsize
-
2
;
size
=
ffio_limit
(
s
->
pb
,
size
);
if
(
size
<
0
||
c
->
pktsize
<
c
->
sndsize
)
return
AVERROR_INVALIDDATA
;
if
(
av_new_packet
(
pkt
,
size
)
<
0
)
if
(
av_new_packet
(
pkt
,
size
+
c
->
gmcsize
+
2
)
<
0
)
return
AVERROR
(
ENOMEM
);
AV_WL16
(
pkt
->
data
,
c
->
flags
);
if
(
c
->
gmcsize
)
memcpy
(
pkt
->
data
+
2
,
c
->
gmc
,
c
->
gmcsize
);
avio_read
(
s
->
pb
,
pkt
->
data
+
2
+
c
->
gmcsize
,
size
-
c
->
gmcsize
-
2
);
avio_read
(
s
->
pb
,
pkt
->
data
+
2
+
c
->
gmcsize
,
size
);
pkt
->
stream_index
=
0
;
c
->
curstrm
=
-
1
;
}
else
{
...
...
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