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
e8e9186a
Commit
e8e9186a
authored
May 22, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/pgssubdec: Use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f932e5f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pgssubdec.c
libavcodec/pgssubdec.c
+2
-2
No files found.
libavcodec/pgssubdec.c
View file @
e8e9186a
...
...
@@ -341,7 +341,7 @@ static int parse_presentation_segment(AVCodecContext *avctx,
}
av_freep
(
&
ctx
->
presentation
.
objects
);
ctx
->
presentation
.
objects
=
av_malloc
(
sizeof
(
PGSSubPictureReference
)
*
ctx
->
presentation
.
object_count
);
ctx
->
presentation
.
objects
=
av_malloc
_array
(
ctx
->
presentation
.
object_count
,
sizeof
(
PGSSubPictureReference
)
);
if
(
!
ctx
->
presentation
.
objects
)
{
ctx
->
presentation
.
object_count
=
0
;
return
AVERROR
(
ENOMEM
);
...
...
@@ -417,7 +417,7 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
sub
->
format
=
0
;
sub
->
num_rects
=
ctx
->
presentation
.
object_count
;
sub
->
rects
=
av_mallocz
(
sizeof
(
*
sub
->
rects
)
*
sub
->
num_rects
);
sub
->
rects
=
av_mallocz
_array
(
sub
->
num_rects
,
sizeof
(
*
sub
->
rects
)
);
for
(
rect
=
0
;
rect
<
sub
->
num_rects
;
++
rect
)
{
uint16_t
picture_id
=
ctx
->
presentation
.
objects
[
rect
].
picture_id
;
...
...
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