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
59697e42
Commit
59697e42
authored
Oct 10, 2019
by
Steven Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/rl2: fix memleak when read end of file
Signed-off-by:
Steven Liu
<
lq@chinaffmpeg.org
>
parent
7a200089
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
rl2.c
libavformat/rl2.c
+13
-7
No files found.
libavformat/rl2.c
View file @
59697e42
...
@@ -171,18 +171,24 @@ static av_cold int rl2_read_header(AVFormatContext *s)
...
@@ -171,18 +171,24 @@ static av_cold int rl2_read_header(AVFormatContext *s)
/** read offset and size tables */
/** read offset and size tables */
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
if
(
avio_feof
(
pb
))
if
(
avio_feof
(
pb
))
{
return
AVERROR_INVALIDDATA
;
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
chunk_size
[
i
]
=
avio_rl32
(
pb
);
chunk_size
[
i
]
=
avio_rl32
(
pb
);
}
}
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
if
(
avio_feof
(
pb
))
if
(
avio_feof
(
pb
))
{
return
AVERROR_INVALIDDATA
;
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
chunk_offset
[
i
]
=
avio_rl32
(
pb
);
chunk_offset
[
i
]
=
avio_rl32
(
pb
);
}
}
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
for
(
i
=
0
;
i
<
frame_count
;
i
++
)
{
if
(
avio_feof
(
pb
))
if
(
avio_feof
(
pb
))
{
return
AVERROR_INVALIDDATA
;
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
audio_size
[
i
]
=
avio_rl32
(
pb
)
&
0xFFFF
;
audio_size
[
i
]
=
avio_rl32
(
pb
)
&
0xFFFF
;
}
}
...
@@ -203,7 +209,7 @@ static av_cold int rl2_read_header(AVFormatContext *s)
...
@@ -203,7 +209,7 @@ static av_cold int rl2_read_header(AVFormatContext *s)
++
video_frame_counter
;
++
video_frame_counter
;
}
}
end:
av_free
(
chunk_size
);
av_free
(
chunk_size
);
av_free
(
audio_size
);
av_free
(
audio_size
);
av_free
(
chunk_offset
);
av_free
(
chunk_offset
);
...
...
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