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
ec17782e
Commit
ec17782e
authored
Feb 02, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvdsubdec: Check memory allocations
parent
e51f2212
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
dvdsubdec.c
libavcodec/dvdsubdec.c
+9
-2
No files found.
libavcodec/dvdsubdec.c
View file @
ec17782e
...
...
@@ -324,16 +324,23 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
sub_header
->
num_rects
=
0
;
}
bitmap
=
av_malloc
(
w
*
h
);
sub_header
->
rects
=
av_mallocz
(
sizeof
(
*
sub_header
->
rects
));
if
(
!
sub_header
->
rects
)
goto
fail
;
sub_header
->
rects
[
0
]
=
av_mallocz
(
sizeof
(
AVSubtitleRect
));
if
(
!
sub_header
->
rects
[
0
])
goto
fail
;
sub_header
->
num_rects
=
1
;
sub_header
->
rects
[
0
]
->
pict
.
data
[
0
]
=
bitmap
;
bitmap
=
sub_header
->
rects
[
0
]
->
pict
.
data
[
0
]
=
av_malloc
(
w
*
h
);
if
(
!
bitmap
)
goto
fail
;
decode_rle
(
bitmap
,
w
*
2
,
w
,
(
h
+
1
)
/
2
,
buf
,
offset1
,
buf_size
,
is_8bit
);
decode_rle
(
bitmap
+
w
,
w
*
2
,
w
,
h
/
2
,
buf
,
offset2
,
buf_size
,
is_8bit
);
sub_header
->
rects
[
0
]
->
pict
.
data
[
1
]
=
av_mallocz
(
AVPALETTE_SIZE
);
if
(
!
sub_header
->
rects
[
0
]
->
pict
.
data
[
1
])
goto
fail
;
if
(
is_8bit
)
{
if
(
yuv_palette
==
0
)
goto
fail
;
...
...
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