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
a4d3cf10
Commit
a4d3cf10
authored
Jan 10, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/diracdec: Check slices malloc and propagate error code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
0b52bdfb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
diracdec.c
libavcodec/diracdec.c
+9
-3
No files found.
libavcodec/diracdec.c
View file @
a4d3cf10
...
...
@@ -772,7 +772,7 @@ static int decode_lowdelay_slice(AVCodecContext *avctx, void *arg)
* Dirac Specification ->
* 13.5.1 low_delay_transform_data()
*/
static
void
decode_lowdelay
(
DiracContext
*
s
)
static
int
decode_lowdelay
(
DiracContext
*
s
)
{
AVCodecContext
*
avctx
=
s
->
avctx
;
int
slice_x
,
slice_y
,
bytes
,
bufsize
;
...
...
@@ -781,6 +781,8 @@ static void decode_lowdelay(DiracContext *s)
int
slice_num
=
0
;
slices
=
av_mallocz_array
(
s
->
lowdelay
.
num_x
,
s
->
lowdelay
.
num_y
*
sizeof
(
struct
lowdelay_slice
));
if
(
!
slices
)
return
AVERROR
(
ENOMEM
);
align_get_bits
(
&
s
->
gb
);
/*[DIRAC_STD] 13.5.2 Slices. slice(sx,sy) */
...
...
@@ -808,6 +810,7 @@ static void decode_lowdelay(DiracContext *s)
intra_dc_prediction
(
&
s
->
plane
[
1
].
band
[
0
][
0
]);
/* [DIRAC_STD] 13.3 intra_dc_prediction() */
intra_dc_prediction
(
&
s
->
plane
[
2
].
band
[
0
][
0
]);
/* [DIRAC_STD] 13.3 intra_dc_prediction() */
av_free
(
slices
);
return
0
;
}
static
void
init_planes
(
DiracContext
*
s
)
...
...
@@ -1590,6 +1593,7 @@ static int dirac_decode_frame_internal(DiracContext *s)
{
DWTContext
d
;
int
y
,
i
,
comp
,
dsty
;
int
ret
;
if
(
s
->
low_delay
)
{
/* [DIRAC_STD] 13.5.1 low_delay_transform_data() */
...
...
@@ -1597,8 +1601,10 @@ static int dirac_decode_frame_internal(DiracContext *s)
Plane
*
p
=
&
s
->
plane
[
comp
];
memset
(
p
->
idwt_buf
,
0
,
p
->
idwt_stride
*
p
->
idwt_height
*
sizeof
(
IDWTELEM
));
}
if
(
!
s
->
zero_res
)
decode_lowdelay
(
s
);
if
(
!
s
->
zero_res
)
{
if
((
ret
=
decode_lowdelay
(
s
))
<
0
)
return
ret
;
}
}
for
(
comp
=
0
;
comp
<
3
;
comp
++
)
{
...
...
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