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
c2a3dcaf
Commit
c2a3dcaf
authored
May 27, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memleak, fixed CID123.
Originally committed as revision 13472 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8e6f8869
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
nutdec.c
libavformat/nutdec.c
+13
-6
No files found.
libavformat/nutdec.c
View file @
c2a3dcaf
...
...
@@ -500,6 +500,7 @@ static int find_and_decode_index(NUTContext *nut){
int64_t
filesize
=
url_fsize
(
bc
);
int64_t
*
syncpoints
;
int8_t
*
has_keyframe
;
int
ret
=
-
1
;
url_fseek
(
bc
,
filesize
-
12
,
SEEK_SET
);
url_fseek
(
bc
,
filesize
-
get_be64
(
bc
),
SEEK_SET
);
...
...
@@ -516,7 +517,9 @@ static int find_and_decode_index(NUTContext *nut){
syncpoints
=
av_malloc
(
sizeof
(
int64_t
)
*
syncpoint_count
);
has_keyframe
=
av_malloc
(
sizeof
(
int8_t
)
*
(
syncpoint_count
+
1
));
for
(
i
=
0
;
i
<
syncpoint_count
;
i
++
){
GET_V
(
syncpoints
[
i
],
tmp
>
0
)
syncpoints
[
i
]
=
ff_get_v
(
bc
);
if
(
syncpoints
[
i
]
<=
0
)
goto
fail
;
if
(
i
)
syncpoints
[
i
]
+=
syncpoints
[
i
-
1
];
}
...
...
@@ -533,7 +536,7 @@ static int find_and_decode_index(NUTContext *nut){
x
>>=
1
;
if
(
n
+
x
>=
syncpoint_count
+
1
){
av_log
(
s
,
AV_LOG_ERROR
,
"index overflow A
\n
"
);
return
-
1
;
goto
fail
;
}
while
(
x
--
)
has_keyframe
[
n
++
]
=
flag
;
...
...
@@ -542,7 +545,7 @@ static int find_and_decode_index(NUTContext *nut){
while
(
x
!=
1
){
if
(
n
>=
syncpoint_count
+
1
){
av_log
(
s
,
AV_LOG_ERROR
,
"index overflow B
\n
"
);
return
-
1
;
goto
fail
;
}
has_keyframe
[
n
++
]
=
x
&
1
;
x
>>=
1
;
...
...
@@ -550,7 +553,7 @@ static int find_and_decode_index(NUTContext *nut){
}
if
(
has_keyframe
[
0
]){
av_log
(
s
,
AV_LOG_ERROR
,
"keyframe before first syncpoint in index
\n
"
);
return
-
1
;
goto
fail
;
}
assert
(
n
<=
syncpoint_count
+
1
);
for
(;
j
<
n
&&
j
<
syncpoint_count
;
j
++
){
...
...
@@ -577,9 +580,13 @@ static int find_and_decode_index(NUTContext *nut){
if
(
skip_reserved
(
bc
,
end
)
||
get_checksum
(
bc
)){
av_log
(
s
,
AV_LOG_ERROR
,
"index checksum mismatch
\n
"
);
return
-
1
;
goto
fail
;
}
return
0
;
ret
=
0
;
fail
:
av_free
(
syncpoints
);
av_free
(
has_keyframe
);
return
ret
;
}
static
int
nut_read_header
(
AVFormatContext
*
s
,
AVFormatParameters
*
ap
)
...
...
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