Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Timothy B. Terriberry
Opusfile
Commits
78d232c1
Commit
78d232c1
authored
Feb 24, 2022
by
Timothy B. Terriberry
Browse files
Fix an unchecked allocation.
Also mark other allocation failures with our unlikely macro.
parent
680139b2
Pipeline
#2746
passed with stage
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/opusfile.c
View file @
78d232c1
...
...
@@ -1549,7 +1549,7 @@ static int op_open_seekable2(OggOpusFile *_of){
start_op_count
=
_of
->
op_count
;
/*This is a bit too large to put on the stack unconditionally.*/
op_start
=
(
ogg_packet
*
)
_ogg_malloc
(
sizeof
(
*
op_start
)
*
start_op_count
);
if
(
op_start
==
NULL
)
return
OP_EFAULT
;
if
(
OP_UNLIKELY
(
op_start
==
NULL
)
)
return
OP_EFAULT
;
*&
oy_start
=
_of
->
oy
;
*&
os_start
=
_of
->
os
;
prev_page_offset
=
_of
->
prev_page_offset
;
...
...
@@ -1669,6 +1669,7 @@ static int op_open1(OggOpusFile *_of,
/*Don't seek yet.
Set up a 'single' (current) logical bitstream entry for partial open.*/
_of
->
links
=
(
OggOpusLink
*
)
_ogg_malloc
(
sizeof
(
*
_of
->
links
));
if
(
OP_UNLIKELY
(
_of
->
links
==
NULL
))
return
OP_EFAULT
;
/*The serialno gets filled in later by op_fetch_headers().*/
ogg_stream_init
(
&
_of
->
os
,
-
1
);
pog
=
NULL
;
...
...
@@ -2902,7 +2903,7 @@ static int op_ensure_buffer(OggOpusFile *_of,int _duration,int _nchannels){
if
(
capacity
>
_of
->
od_buffer_capacity
){
op_sample
*
new_buffer
;
new_buffer
=
(
op_sample
*
)
_ogg_realloc
(
_of
->
od_buffer
,
capacity
);
if
(
new_buffer
==
NULL
)
return
OP_EFAULT
;
if
(
OP_UNLIKELY
(
new_buffer
==
NULL
)
)
return
OP_EFAULT
;
_of
->
od_buffer
=
new_buffer
;
_of
->
od_buffer_capacity
=
capacity
;
}
...
...
Write
Preview
Supports
Markdown
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