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
95891804
Commit
95891804
authored
Sep 25, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3on4: check for allocation failures in decode_init_mp3on4()
parent
180bf988
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
mpegaudiodec.c
libavcodec/mpegaudiodec.c
+4
-0
No files found.
libavcodec/mpegaudiodec.c
View file @
95891804
...
@@ -1972,6 +1972,8 @@ static int decode_init_mp3on4(AVCodecContext * avctx)
...
@@ -1972,6 +1972,8 @@ static int decode_init_mp3on4(AVCodecContext * avctx)
*/
*/
// Allocate zeroed memory for the first decoder context
// Allocate zeroed memory for the first decoder context
s
->
mp3decctx
[
0
]
=
av_mallocz
(
sizeof
(
MPADecodeContext
));
s
->
mp3decctx
[
0
]
=
av_mallocz
(
sizeof
(
MPADecodeContext
));
if
(
!
s
->
mp3decctx
[
0
])
goto
alloc_fail
;
// Put decoder context in place to make init_decode() happy
// Put decoder context in place to make init_decode() happy
avctx
->
priv_data
=
s
->
mp3decctx
[
0
];
avctx
->
priv_data
=
s
->
mp3decctx
[
0
];
decode_init
(
avctx
);
decode_init
(
avctx
);
...
@@ -1984,6 +1986,8 @@ static int decode_init_mp3on4(AVCodecContext * avctx)
...
@@ -1984,6 +1986,8 @@ static int decode_init_mp3on4(AVCodecContext * avctx)
*/
*/
for
(
i
=
1
;
i
<
s
->
frames
;
i
++
)
{
for
(
i
=
1
;
i
<
s
->
frames
;
i
++
)
{
s
->
mp3decctx
[
i
]
=
av_mallocz
(
sizeof
(
MPADecodeContext
));
s
->
mp3decctx
[
i
]
=
av_mallocz
(
sizeof
(
MPADecodeContext
));
if
(
!
s
->
mp3decctx
[
i
])
goto
alloc_fail
;
s
->
mp3decctx
[
i
]
->
adu_mode
=
1
;
s
->
mp3decctx
[
i
]
->
adu_mode
=
1
;
s
->
mp3decctx
[
i
]
->
avctx
=
avctx
;
s
->
mp3decctx
[
i
]
->
avctx
=
avctx
;
s
->
mp3decctx
[
i
]
->
mpadsp
=
s
->
mp3decctx
[
0
]
->
mpadsp
;
s
->
mp3decctx
[
i
]
->
mpadsp
=
s
->
mp3decctx
[
0
]
->
mpadsp
;
...
...
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