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
2f0e0dea
Commit
2f0e0dea
authored
Apr 04, 2018
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/matroskadec: address a missing AVPacket free
Fixes memleaks. Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
2accdd38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
matroskadec.c
libavformat/matroskadec.c
+2
-11
No files found.
libavformat/matroskadec.c
View file @
2f0e0dea
...
...
@@ -3152,7 +3152,7 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
MatroskaTrackEncoding
*
encodings
=
track
->
encodings
.
elem
;
uint8_t
*
pkt_data
=
data
;
int
offset
=
0
,
res
;
AVPacket
*
pkt
;
AVPacket
pktl
,
*
pkt
=
&
pktl
;
if
(
encodings
&&
!
encodings
->
type
&&
encodings
->
scope
&
1
)
{
res
=
matroska_decode_buffer
(
&
pkt_data
,
&
pkt_size
,
track
);
...
...
@@ -3177,15 +3177,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
AV_RB32
(
&
data
[
4
])
!=
MKBETAG
(
'i'
,
'c'
,
'p'
,
'f'
))
offset
=
8
;
pkt
=
av_mallocz
(
sizeof
(
AVPacket
));
if
(
!
pkt
)
{
if
(
pkt_data
!=
data
)
av_freep
(
&
pkt_data
);
return
AVERROR
(
ENOMEM
);
}
/* XXX: prevent data copy... */
if
(
av_new_packet
(
pkt
,
pkt_size
+
offset
)
<
0
)
{
av_free
(
pkt
);
res
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
...
...
@@ -3210,7 +3203,6 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
additional_size
+
8
);
if
(
!
side_data
)
{
av_packet_unref
(
pkt
);
av_free
(
pkt
);
return
AVERROR
(
ENOMEM
);
}
AV_WB64
(
side_data
,
additional_id
);
...
...
@@ -3223,7 +3215,6 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
10
);
if
(
!
side_data
)
{
av_packet_unref
(
pkt
);
av_free
(
pkt
);
return
AVERROR
(
ENOMEM
);
}
discard_padding
=
av_rescale_q
(
discard_padding
,
...
...
@@ -3253,7 +3244,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
res
=
ff_packet_list_put
(
&
matroska
->
queue
,
&
matroska
->
queue_end
,
pkt
,
0
);
if
(
res
<
0
)
{
av_packet_
free
(
&
pkt
);
av_packet_
unref
(
pkt
);
return
AVERROR
(
ENOMEM
);
}
...
...
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