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
35e559ae
Commit
35e559ae
authored
Jan 10, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/cavs: Check for av_malloc* failure in ff_cavs_init_top_lines()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6f838dee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
cavs.c
libavcodec/cavs.c
+18
-1
cavs.h
libavcodec/cavs.h
+1
-1
cavsdec.c
libavcodec/cavsdec.c
+1
-1
No files found.
libavcodec/cavs.c
View file @
35e559ae
...
...
@@ -751,7 +751,7 @@ int ff_cavs_init_pic(AVSContext *h)
* this data has to be stored for one complete row of macroblocks
* and this storage space is allocated here
*/
void
ff_cavs_init_top_lines
(
AVSContext
*
h
)
int
ff_cavs_init_top_lines
(
AVSContext
*
h
)
{
/* alloc top line of predictors */
h
->
top_qp
=
av_mallocz
(
h
->
mb_width
);
...
...
@@ -767,6 +767,23 @@ void ff_cavs_init_top_lines(AVSContext *h)
4
*
sizeof
(
cavs_vector
));
h
->
col_type_base
=
av_mallocz
(
h
->
mb_width
*
h
->
mb_height
);
h
->
block
=
av_mallocz
(
64
*
sizeof
(
int16_t
));
if
(
!
h
->
top_qp
||
!
h
->
top_mv
[
0
]
||
!
h
->
top_mv
[
1
]
||
!
h
->
top_pred_Y
||
!
h
->
top_border_y
||
!
h
->
top_border_u
||
!
h
->
top_border_v
||
!
h
->
col_mv
||
!
h
->
col_type_base
||
!
h
->
block
)
{
av_freep
(
&
h
->
top_qp
);
av_freep
(
&
h
->
top_mv
[
0
]);
av_freep
(
&
h
->
top_mv
[
1
]);
av_freep
(
&
h
->
top_pred_Y
);
av_freep
(
&
h
->
top_border_y
);
av_freep
(
&
h
->
top_border_u
);
av_freep
(
&
h
->
top_border_v
);
av_freep
(
&
h
->
col_mv
);
av_freep
(
&
h
->
col_type_base
);
av_freep
(
&
h
->
block
);
return
AVERROR
(
ENOMEM
);
}
return
0
;
}
av_cold
int
ff_cavs_init
(
AVCodecContext
*
avctx
)
...
...
libavcodec/cavs.h
View file @
35e559ae
...
...
@@ -272,7 +272,7 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
void
ff_cavs_init_mb
(
AVSContext
*
h
);
int
ff_cavs_next_mb
(
AVSContext
*
h
);
int
ff_cavs_init_pic
(
AVSContext
*
h
);
void
ff_cavs_init_top_lines
(
AVSContext
*
h
);
int
ff_cavs_init_top_lines
(
AVSContext
*
h
);
int
ff_cavs_init
(
AVCodecContext
*
avctx
);
int
ff_cavs_end
(
AVCodecContext
*
avctx
);
...
...
libavcodec/cavsdec.c
View file @
35e559ae
...
...
@@ -1151,7 +1151,7 @@ static int decode_seq_header(AVSContext *h)
h
->
avctx
->
width
=
h
->
width
;
h
->
avctx
->
height
=
h
->
height
;
if
(
!
h
->
top_qp
)
ff_cavs_init_top_lines
(
h
);
return
ff_cavs_init_top_lines
(
h
);
return
0
;
}
...
...
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