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
0c7b44a0
Commit
0c7b44a0
authored
Oct 22, 2015
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_psnr/ssim: don't crash if stats_file is NULL.
parent
a60539bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
22 deletions
+26
-22
vf_psnr.c
libavfilter/vf_psnr.c
+13
-11
vf_ssim.c
libavfilter/vf_ssim.c
+13
-11
No files found.
libavfilter/vf_psnr.c
View file @
0c7b44a0
...
...
@@ -193,17 +193,19 @@ static av_cold int init(AVFilterContext *ctx)
s
->
min_mse
=
+
INFINITY
;
s
->
max_mse
=
-
INFINITY
;
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
s
->
stats_file
=
stdout
;
}
else
if
(
s
->
stats_file_str
)
{
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
if
(
!
s
->
stats_file
)
{
int
err
=
AVERROR
(
errno
);
char
buf
[
128
];
av_strerror
(
err
,
buf
,
sizeof
(
buf
));
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open stats file %s: %s
\n
"
,
s
->
stats_file_str
,
buf
);
return
err
;
if
(
s
->
stats_file_str
)
{
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
s
->
stats_file
=
stdout
;
}
else
{
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
if
(
!
s
->
stats_file
)
{
int
err
=
AVERROR
(
errno
);
char
buf
[
128
];
av_strerror
(
err
,
buf
,
sizeof
(
buf
));
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open stats file %s: %s
\n
"
,
s
->
stats_file_str
,
buf
);
return
err
;
}
}
}
...
...
libavfilter/vf_ssim.c
View file @
0c7b44a0
...
...
@@ -223,17 +223,19 @@ static av_cold int init(AVFilterContext *ctx)
{
SSIMContext
*
s
=
ctx
->
priv
;
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
s
->
stats_file
=
stdout
;
}
else
if
(
s
->
stats_file_str
)
{
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
if
(
!
s
->
stats_file
)
{
int
err
=
AVERROR
(
errno
);
char
buf
[
128
];
av_strerror
(
err
,
buf
,
sizeof
(
buf
));
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open stats file %s: %s
\n
"
,
s
->
stats_file_str
,
buf
);
return
err
;
if
(
s
->
stats_file_str
)
{
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
s
->
stats_file
=
stdout
;
}
else
{
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
if
(
!
s
->
stats_file
)
{
int
err
=
AVERROR
(
errno
);
char
buf
[
128
];
av_strerror
(
err
,
buf
,
sizeof
(
buf
));
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open stats file %s: %s
\n
"
,
s
->
stats_file_str
,
buf
);
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