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
99a33529
Commit
99a33529
authored
Apr 13, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faxcompr: Check malloc results and unify return path
parent
6555acad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
faxcompr.c
libavcodec/faxcompr.c
+10
-5
No files found.
libavcodec/faxcompr.c
View file @
99a33529
...
...
@@ -275,12 +275,17 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
{
int
j
;
GetBitContext
gb
;
int
*
runs
,
*
ref
,
*
runend
;
int
*
runs
,
*
ref
=
NULL
,
*
runend
;
int
ret
;
int
runsize
=
avctx
->
width
+
2
;
int
err
=
0
;
runs
=
av_malloc
(
runsize
*
sizeof
(
runs
[
0
]));
ref
=
av_malloc
(
runsize
*
sizeof
(
ref
[
0
]));
if
(
!
runs
||
!
ref
)
{
err
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
ref
[
0
]
=
avctx
->
width
;
ref
[
1
]
=
0
;
ref
[
2
]
=
0
;
...
...
@@ -290,9 +295,8 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
if
(
compr
==
TIFF_G4
){
ret
=
decode_group3_2d_line
(
avctx
,
&
gb
,
avctx
->
width
,
runs
,
runend
,
ref
);
if
(
ret
<
0
){
av_free
(
runs
);
av_free
(
ref
);
return
-
1
;
err
=
-
1
;
goto
fail
;
}
}
else
{
int
g3d1
=
(
compr
==
TIFF_G3
)
&&
!
(
opts
&
1
);
...
...
@@ -313,7 +317,8 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
}
dst
+=
stride
;
}
fail:
av_free
(
runs
);
av_free
(
ref
);
return
0
;
return
err
;
}
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