Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
3b08e046
Commit
3b08e046
authored
Feb 11, 2022
by
Andreas Rheinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/alsdec, mlz: Check allocation
Signed-off-by:
Andreas Rheinhardt
<
andreas.rheinhardt@outlook.com
>
parent
e925d545
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
alsdec.c
libavcodec/alsdec.c
+3
-1
mlz.c
libavcodec/mlz.c
+6
-1
mlz.h
libavcodec/mlz.h
+1
-1
No files found.
libavcodec/alsdec.c
View file @
3b08e046
...
...
@@ -2111,7 +2111,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
return
AVERROR
(
ENOMEM
);
}
ff_mlz_init_dict
(
avctx
,
ctx
->
mlz
);
ret
=
ff_mlz_init_dict
(
avctx
,
ctx
->
mlz
);
if
(
ret
<
0
)
return
ret
;
ff_mlz_flush_dict
(
ctx
->
mlz
);
for
(
c
=
0
;
c
<
avctx
->
channels
;
++
c
)
{
...
...
libavcodec/mlz.c
View file @
3b08e046
...
...
@@ -20,8 +20,11 @@
#include "mlz.h"
av_cold
void
ff_mlz_init_dict
(
void
*
context
,
MLZ
*
mlz
)
{
av_cold
int
ff_mlz_init_dict
(
void
*
context
,
MLZ
*
mlz
)
{
mlz
->
dict
=
av_mallocz
(
TABLE_SIZE
*
sizeof
(
*
mlz
->
dict
));
if
(
!
mlz
->
dict
)
return
AVERROR
(
ENOMEM
);
mlz
->
flush_code
=
FLUSH_CODE
;
mlz
->
current_dic_index_max
=
DIC_INDEX_INIT
;
...
...
@@ -30,6 +33,8 @@ av_cold void ff_mlz_init_dict(void* context, MLZ *mlz) {
mlz
->
next_code
=
FIRST_CODE
;
mlz
->
freeze_flag
=
0
;
mlz
->
context
=
context
;
return
0
;
}
av_cold
void
ff_mlz_flush_dict
(
MLZ
*
mlz
)
{
...
...
libavcodec/mlz.h
View file @
3b08e046
...
...
@@ -57,7 +57,7 @@ typedef struct MLZ {
/** Initialize the dictionary
*/
void
ff_mlz_init_dict
(
void
*
context
,
MLZ
*
mlz
);
int
ff_mlz_init_dict
(
void
*
context
,
MLZ
*
mlz
);
/** Flush the dictionary
*/
...
...
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