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
a594f17f
Commit
a594f17f
authored
Jun 13, 2017
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvbsubdec: Free subrect memory on allocation error
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
1cfd5663
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
dvbsubdec.c
libavcodec/dvbsubdec.c
+8
-0
No files found.
libavcodec/dvbsubdec.c
View file @
a594f17f
...
...
@@ -1293,6 +1293,10 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
for
(
i
=
0
;
i
<
sub
->
num_rects
;
i
++
)
{
sub
->
rects
[
i
]
=
av_mallocz
(
sizeof
(
*
sub
->
rects
[
i
]));
if
(
!
sub
->
rects
[
i
])
{
int
j
;
for
(
j
=
0
;
j
<
i
;
j
++
)
av_free
(
sub
->
rects
[
j
]);
av_free
(
sub
->
rects
);
return
AVERROR
(
ENOMEM
);
}
}
...
...
@@ -1335,6 +1339,8 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
rect
->
data
[
1
]
=
av_mallocz
(
AVPALETTE_SIZE
);
if
(
!
rect
->
data
[
1
])
{
for
(
i
=
0
;
i
<
sub
->
num_rects
;
i
++
)
av_free
(
sub
->
rects
[
i
]);
av_free
(
sub
->
rects
);
return
AVERROR
(
ENOMEM
);
}
...
...
@@ -1343,6 +1349,8 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
rect
->
data
[
0
]
=
av_malloc
(
region
->
buf_size
);
if
(
!
rect
->
data
[
0
])
{
av_free
(
rect
->
data
[
1
]);
for
(
i
=
0
;
i
<
sub
->
num_rects
;
i
++
)
av_free
(
sub
->
rects
[
i
]);
av_free
(
sub
->
rects
);
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