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
Show 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,9 +193,10 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -193,9 +193,10 @@ static av_cold int init(AVFilterContext *ctx)
s
->
min_mse
=
+
INFINITY
;
s
->
min_mse
=
+
INFINITY
;
s
->
max_mse
=
-
INFINITY
;
s
->
max_mse
=
-
INFINITY
;
if
(
s
->
stats_file_str
)
{
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
s
->
stats_file
=
stdout
;
s
->
stats_file
=
stdout
;
}
else
if
(
s
->
stats_file_str
)
{
}
else
{
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
if
(
!
s
->
stats_file
)
{
if
(
!
s
->
stats_file
)
{
int
err
=
AVERROR
(
errno
);
int
err
=
AVERROR
(
errno
);
...
@@ -206,6 +207,7 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -206,6 +207,7 @@ static av_cold int init(AVFilterContext *ctx)
return
err
;
return
err
;
}
}
}
}
}
s
->
dinput
.
process
=
do_psnr
;
s
->
dinput
.
process
=
do_psnr
;
return
0
;
return
0
;
...
...
libavfilter/vf_ssim.c
View file @
0c7b44a0
...
@@ -223,9 +223,10 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -223,9 +223,10 @@ static av_cold int init(AVFilterContext *ctx)
{
{
SSIMContext
*
s
=
ctx
->
priv
;
SSIMContext
*
s
=
ctx
->
priv
;
if
(
s
->
stats_file_str
)
{
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
if
(
!
strcmp
(
s
->
stats_file_str
,
"-"
))
{
s
->
stats_file
=
stdout
;
s
->
stats_file
=
stdout
;
}
else
if
(
s
->
stats_file_str
)
{
}
else
{
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
s
->
stats_file
=
fopen
(
s
->
stats_file_str
,
"w"
);
if
(
!
s
->
stats_file
)
{
if
(
!
s
->
stats_file
)
{
int
err
=
AVERROR
(
errno
);
int
err
=
AVERROR
(
errno
);
...
@@ -236,6 +237,7 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -236,6 +237,7 @@ static av_cold int init(AVFilterContext *ctx)
return
err
;
return
err
;
}
}
}
}
}
s
->
dinput
.
process
=
do_ssim
;
s
->
dinput
.
process
=
do_ssim
;
s
->
dinput
.
shortest
=
1
;
s
->
dinput
.
shortest
=
1
;
...
...
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