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
68fa5492
Commit
68fa5492
authored
Dec 25, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/segment: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1515bfb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
segment.c
libavformat/segment.c
+7
-7
No files found.
libavformat/segment.c
View file @
68fa5492
...
...
@@ -343,7 +343,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
if
(
seg
->
list_size
&&
seg
->
segment_count
>=
seg
->
list_size
)
{
entry
=
seg
->
segment_list_entries
;
seg
->
segment_list_entries
=
seg
->
segment_list_entries
->
next
;
av_free
(
entry
->
filename
);
av_free
p
(
&
entry
->
filename
);
av_freep
(
&
entry
);
}
...
...
@@ -501,10 +501,10 @@ static int open_null_ctx(AVIOContext **ctx)
return
0
;
}
static
void
close_null_ctx
(
AVIOContext
*
pb
)
static
void
close_null_ctx
p
(
AVIOContext
*
*
pb
)
{
av_free
(
pb
->
buffer
);
av_free
(
pb
);
av_free
p
(
&
(
*
pb
)
->
buffer
);
av_free
p
(
pb
);
}
static
int
select_reference_stream
(
AVFormatContext
*
s
)
...
...
@@ -687,7 +687,7 @@ static int seg_write_header(AVFormatContext *s)
s
->
avoid_negative_ts
=
1
;
if
(
!
seg
->
write_header_trailer
)
{
close_null_ctx
(
oc
->
pb
);
close_null_ctx
p
(
&
oc
->
pb
);
if
((
ret
=
avio_open2
(
&
oc
->
pb
,
oc
->
filename
,
AVIO_FLAG_WRITE
,
&
s
->
interrupt_callback
,
NULL
))
<
0
)
goto
fail
;
...
...
@@ -820,7 +820,7 @@ static int seg_write_trailer(struct AVFormatContext *s)
goto
fail
;
open_null_ctx
(
&
oc
->
pb
);
ret
=
av_write_trailer
(
oc
);
close_null_ctx
(
oc
->
pb
);
close_null_ctx
p
(
&
oc
->
pb
);
}
else
{
ret
=
segment_end
(
s
,
1
,
1
);
}
...
...
@@ -836,7 +836,7 @@ fail:
cur
=
seg
->
segment_list_entries
;
while
(
cur
)
{
next
=
cur
->
next
;
av_free
(
cur
->
filename
);
av_free
p
(
&
cur
->
filename
);
av_free
(
cur
);
cur
=
next
;
}
...
...
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