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
443bd271
Commit
443bd271
authored
Dec 25, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/wtvdec: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
68fa5492
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
wtvdec.c
libavformat/wtvdec.c
+10
-10
No files found.
libavformat/wtvdec.c
View file @
443bd271
...
...
@@ -204,8 +204,8 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
wf
->
sector_bits
=
length
&
(
1ULL
<<
63
)
?
WTV_SECTOR_BITS
:
WTV_BIGSECTOR_BITS
;
if
(
!
wf
->
nb_sectors
)
{
av_free
(
wf
->
sectors
);
av_free
(
wf
);
av_free
p
(
&
wf
->
sectors
);
av_free
p
(
&
wf
);
return
NULL
;
}
...
...
@@ -224,25 +224,25 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int
/* seek to initial sector */
wf
->
position
=
0
;
if
(
seek_by_sector
(
s
->
pb
,
wf
->
sectors
[
0
],
0
)
<
0
)
{
av_free
(
wf
->
sectors
);
av_free
(
wf
);
av_free
p
(
&
wf
->
sectors
);
av_free
p
(
&
wf
);
return
NULL
;
}
wf
->
pb_filesystem
=
s
->
pb
;
buffer
=
av_malloc
(
1
<<
wf
->
sector_bits
);
if
(
!
buffer
)
{
av_free
(
wf
->
sectors
);
av_free
(
wf
);
av_free
p
(
&
wf
->
sectors
);
av_free
p
(
&
wf
);
return
NULL
;
}
pb
=
avio_alloc_context
(
buffer
,
1
<<
wf
->
sector_bits
,
0
,
wf
,
wtvfile_read_packet
,
NULL
,
wtvfile_seek
);
if
(
!
pb
)
{
av_free
(
buffer
);
av_free
(
wf
->
sectors
);
av_free
(
wf
);
av_free
p
(
&
buffer
);
av_free
p
(
&
wf
->
sectors
);
av_free
p
(
&
wf
);
}
return
pb
;
}
...
...
@@ -304,7 +304,7 @@ static AVIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int b
static
void
wtvfile_close
(
AVIOContext
*
pb
)
{
WtvFile
*
wf
=
pb
->
opaque
;
av_free
(
wf
->
sectors
);
av_free
p
(
&
wf
->
sectors
);
av_freep
(
&
pb
->
opaque
);
av_freep
(
&
pb
->
buffer
);
av_free
(
pb
);
...
...
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