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
210461c0
Commit
210461c0
authored
Dec 17, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imgconvert: check memory allocations and propagate errors
parent
596b5c48
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
imgconvert.c
libavcodec/imgconvert.c
+11
-5
No files found.
libavcodec/imgconvert.c
View file @
210461c0
...
@@ -427,13 +427,15 @@ static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
...
@@ -427,13 +427,15 @@ static void deinterlace_bottom_field(uint8_t *dst, int dst_wrap,
deinterlace_line
(
dst
,
src_m2
,
src_m1
,
src_0
,
src_0
,
src_0
,
width
);
deinterlace_line
(
dst
,
src_m2
,
src_m1
,
src_0
,
src_0
,
src_0
,
width
);
}
}
static
void
deinterlace_bottom_field_inplace
(
uint8_t
*
src1
,
int
src_wrap
,
static
int
deinterlace_bottom_field_inplace
(
uint8_t
*
src1
,
int
src_wrap
,
int
width
,
int
height
)
int
width
,
int
height
)
{
{
uint8_t
*
src_m1
,
*
src_0
,
*
src_p1
,
*
src_p2
;
uint8_t
*
src_m1
,
*
src_0
,
*
src_p1
,
*
src_p2
;
int
y
;
int
y
;
uint8_t
*
buf
;
uint8_t
*
buf
;
buf
=
av_malloc
(
width
);
buf
=
av_malloc
(
width
);
if
(
!
buf
)
return
AVERROR
(
ENOMEM
);
src_m1
=
src1
;
src_m1
=
src1
;
memcpy
(
buf
,
src_m1
,
width
);
memcpy
(
buf
,
src_m1
,
width
);
...
@@ -450,12 +452,13 @@ static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
...
@@ -450,12 +452,13 @@ static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
/* do last line */
/* do last line */
deinterlace_line_inplace
(
buf
,
src_m1
,
src_0
,
src_0
,
src_0
,
width
);
deinterlace_line_inplace
(
buf
,
src_m1
,
src_0
,
src_0
,
src_0
,
width
);
av_free
(
buf
);
av_free
(
buf
);
return
0
;
}
}
int
avpicture_deinterlace
(
AVPicture
*
dst
,
const
AVPicture
*
src
,
int
avpicture_deinterlace
(
AVPicture
*
dst
,
const
AVPicture
*
src
,
enum
AVPixelFormat
pix_fmt
,
int
width
,
int
height
)
enum
AVPixelFormat
pix_fmt
,
int
width
,
int
height
)
{
{
int
i
;
int
i
,
ret
;
if
(
pix_fmt
!=
AV_PIX_FMT_YUV420P
&&
if
(
pix_fmt
!=
AV_PIX_FMT_YUV420P
&&
pix_fmt
!=
AV_PIX_FMT_YUVJ420P
&&
pix_fmt
!=
AV_PIX_FMT_YUVJ420P
&&
...
@@ -491,8 +494,11 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
...
@@ -491,8 +494,11 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
}
}
}
}
if
(
src
==
dst
)
{
if
(
src
==
dst
)
{
deinterlace_bottom_field_inplace
(
dst
->
data
[
i
],
dst
->
linesize
[
i
],
ret
=
deinterlace_bottom_field_inplace
(
dst
->
data
[
i
],
dst
->
linesize
[
i
],
width
,
height
);
width
,
height
);
if
(
ret
<
0
)
return
ret
;
}
else
{
}
else
{
deinterlace_bottom_field
(
dst
->
data
[
i
],
dst
->
linesize
[
i
],
deinterlace_bottom_field
(
dst
->
data
[
i
],
dst
->
linesize
[
i
],
src
->
data
[
i
],
src
->
linesize
[
i
],
src
->
data
[
i
],
src
->
linesize
[
i
],
...
...
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