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
24ec7a5e
Commit
24ec7a5e
authored
Apr 28, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sws: Check for malloc failure of rgb0_tmp
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
0c47c902
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
swscale.c
libswscale/swscale.c
+6
-0
No files found.
libswscale/swscale.c
View file @
24ec7a5e
...
...
@@ -968,6 +968,9 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
uint8_t
*
base
;
int
x
,
y
;
rgb0_tmp
=
av_malloc
(
FFABS
(
srcStride
[
0
])
*
srcSliceH
+
32
);
if
(
!
rgb0_tmp
)
return
AVERROR
(
ENOMEM
);
base
=
srcStride
[
0
]
<
0
?
rgb0_tmp
-
srcStride
[
0
]
*
(
srcSliceH
-
1
)
:
rgb0_tmp
;
for
(
y
=
0
;
y
<
srcSliceH
;
y
++
){
memcpy
(
base
+
srcStride
[
0
]
*
y
,
src2
[
0
]
+
srcStride
[
0
]
*
y
,
4
*
c
->
srcW
);
...
...
@@ -981,6 +984,9 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
if
(
c
->
srcXYZ
&&
!
(
c
->
dstXYZ
&&
c
->
srcW
==
c
->
dstW
&&
c
->
srcH
==
c
->
dstH
))
{
uint8_t
*
base
;
rgb0_tmp
=
av_malloc
(
FFABS
(
srcStride
[
0
])
*
srcSliceH
+
32
);
if
(
!
rgb0_tmp
)
return
AVERROR
(
ENOMEM
);
base
=
srcStride
[
0
]
<
0
?
rgb0_tmp
-
srcStride
[
0
]
*
(
srcSliceH
-
1
)
:
rgb0_tmp
;
xyz12Torgb48
(
c
,
base
,
src2
[
0
],
srcStride
[
0
]
/
2
,
srcSliceH
);
...
...
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