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
84343dd9
Commit
84343dd9
authored
Jun 30, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indeo3: check return values of av_malloc()
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b00e56be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
indeo3.c
libavcodec/indeo3.c
+19
-16
No files found.
libavcodec/indeo3.c
View file @
84343dd9
...
...
@@ -148,6 +148,20 @@ static av_cold void build_requant_tab(void)
}
static
av_cold
void
free_frame_buffers
(
Indeo3DecodeContext
*
ctx
)
{
int
p
;
ctx
->
width
=
ctx
->
height
=
0
;
for
(
p
=
0
;
p
<
3
;
p
++
)
{
av_freep
(
&
ctx
->
planes
[
p
].
buffers
[
0
]);
av_freep
(
&
ctx
->
planes
[
p
].
buffers
[
1
]);
ctx
->
planes
[
p
].
pixels
[
0
]
=
ctx
->
planes
[
p
].
pixels
[
1
]
=
0
;
}
}
static
av_cold
int
allocate_frame_buffers
(
Indeo3DecodeContext
*
ctx
,
AVCodecContext
*
avctx
,
int
luma_width
,
int
luma_height
)
{
...
...
@@ -188,6 +202,11 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
ctx
->
planes
[
p
].
buffers
[
0
]
=
av_malloc
(
!
p
?
luma_size
:
chroma_size
);
ctx
->
planes
[
p
].
buffers
[
1
]
=
av_malloc
(
!
p
?
luma_size
:
chroma_size
);
if
(
!
ctx
->
planes
[
p
].
buffers
[
0
]
||
!
ctx
->
planes
[
p
].
buffers
[
1
])
{
free_frame_buffers
(
ctx
);
return
AVERROR
(
ENOMEM
);
}
/* fill the INTRA prediction lines with the middle pixel value = 64 */
memset
(
ctx
->
planes
[
p
].
buffers
[
0
],
0x40
,
ctx
->
planes
[
p
].
pitch
);
memset
(
ctx
->
planes
[
p
].
buffers
[
1
],
0x40
,
ctx
->
planes
[
p
].
pitch
);
...
...
@@ -202,22 +221,6 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
return
0
;
}
static
av_cold
void
free_frame_buffers
(
Indeo3DecodeContext
*
ctx
)
{
int
p
;
ctx
->
width
=
ctx
->
height
=
0
;
for
(
p
=
0
;
p
<
3
;
p
++
)
{
av_freep
(
&
ctx
->
planes
[
p
].
buffers
[
0
]);
av_freep
(
&
ctx
->
planes
[
p
].
buffers
[
1
]);
ctx
->
planes
[
p
].
pixels
[
0
]
=
ctx
->
planes
[
p
].
pixels
[
1
]
=
0
;
}
}
/**
* Copy pixels of the cell(x + mv_x, y + mv_y) from the previous frame into
* the cell(x, y) in the current frame.
...
...
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