Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
4902780d
Commit
4902780d
authored
Nov 11, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_lut3d: use av_sscanf
parent
4b30726d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
vf_lut3d.c
libavfilter/vf_lut3d.c
+8
-8
No files found.
libavfilter/vf_lut3d.c
View file @
4902780d
...
...
@@ -367,7 +367,7 @@ static int parse_dat(AVFilterContext *ctx, FILE *f)
struct
rgbvec
*
vec
=
&
lut3d
->
lut
[
k
][
j
][
i
];
if
(
k
!=
0
||
j
!=
0
||
i
!=
0
)
NEXT_LINE
(
skip_line
(
line
));
if
(
sscanf
(
line
,
"%f %f %f"
,
&
vec
->
r
,
&
vec
->
g
,
&
vec
->
b
)
!=
3
)
if
(
av_
sscanf
(
line
,
"%f %f %f"
,
&
vec
->
r
,
&
vec
->
g
,
&
vec
->
b
)
!=
3
)
return
AVERROR_INVALIDDATA
;
}
}
...
...
@@ -407,7 +407,7 @@ try_again:
else
if
(
!
strncmp
(
line
+
7
,
"MAX "
,
4
))
vals
=
max
;
if
(
!
vals
)
return
AVERROR_INVALIDDATA
;
sscanf
(
line
+
11
,
"%f %f %f"
,
vals
,
vals
+
1
,
vals
+
2
);
av_
sscanf
(
line
+
11
,
"%f %f %f"
,
vals
,
vals
+
1
,
vals
+
2
);
av_log
(
ctx
,
AV_LOG_DEBUG
,
"min: %f %f %f | max: %f %f %f
\n
"
,
min
[
0
],
min
[
1
],
min
[
2
],
max
[
0
],
max
[
1
],
max
[
2
]);
goto
try_again
;
...
...
@@ -415,7 +415,7 @@ try_again:
goto
try_again
;
}
}
while
(
skip_line
(
line
));
if
(
sscanf
(
line
,
"%f %f %f"
,
&
vec
->
r
,
&
vec
->
g
,
&
vec
->
b
)
!=
3
)
if
(
av_
sscanf
(
line
,
"%f %f %f"
,
&
vec
->
r
,
&
vec
->
g
,
&
vec
->
b
)
!=
3
)
return
AVERROR_INVALIDDATA
;
vec
->
r
*=
max
[
0
]
-
min
[
0
];
vec
->
g
*=
max
[
1
]
-
min
[
1
];
...
...
@@ -448,7 +448,7 @@ static int parse_3dl(AVFilterContext *ctx, FILE *f)
struct
rgbvec
*
vec
=
&
lut3d
->
lut
[
k
][
j
][
i
];
NEXT_LINE
(
skip_line
(
line
));
if
(
sscanf
(
line
,
"%d %d %d"
,
&
r
,
&
g
,
&
b
)
!=
3
)
if
(
av_
sscanf
(
line
,
"%d %d %d"
,
&
r
,
&
g
,
&
b
)
!=
3
)
return
AVERROR_INVALIDDATA
;
vec
->
r
=
r
/
scale
;
vec
->
g
=
g
/
scale
;
...
...
@@ -512,7 +512,7 @@ static int parse_m3d(AVFilterContext *ctx, FILE *f)
float
val
[
3
];
NEXT_LINE
(
0
);
if
(
sscanf
(
line
,
"%f %f %f"
,
val
,
val
+
1
,
val
+
2
)
!=
3
)
if
(
av_
sscanf
(
line
,
"%f %f %f"
,
val
,
val
+
1
,
val
+
2
)
!=
3
)
return
AVERROR_INVALIDDATA
;
vec
->
r
=
val
[
rgb_map
[
0
]]
*
scale
;
vec
->
g
=
val
[
rgb_map
[
1
]]
*
scale
;
...
...
@@ -1046,12 +1046,12 @@ try_again:
else
if
(
!
strncmp
(
line
+
7
,
"MAX "
,
4
))
vals
=
max
;
if
(
!
vals
)
return
AVERROR_INVALIDDATA
;
sscanf
(
line
+
11
,
"%f %f %f"
,
vals
,
vals
+
1
,
vals
+
2
);
av_
sscanf
(
line
+
11
,
"%f %f %f"
,
vals
,
vals
+
1
,
vals
+
2
);
av_log
(
ctx
,
AV_LOG_DEBUG
,
"min: %f %f %f | max: %f %f %f
\n
"
,
min
[
0
],
min
[
1
],
min
[
2
],
max
[
0
],
max
[
1
],
max
[
2
]);
goto
try_again
;
}
else
if
(
!
strncmp
(
line
,
"LUT_1D_INPUT_RANGE "
,
19
))
{
sscanf
(
line
+
19
,
"%f %f"
,
min
,
max
);
av_
sscanf
(
line
+
19
,
"%f %f"
,
min
,
max
);
min
[
1
]
=
min
[
2
]
=
min
[
0
];
max
[
1
]
=
max
[
2
]
=
max
[
0
];
goto
try_again
;
...
...
@@ -1059,7 +1059,7 @@ try_again:
goto
try_again
;
}
}
while
(
skip_line
(
line
));
if
(
sscanf
(
line
,
"%f %f %f"
,
&
lut1d
->
lut
[
0
][
i
],
&
lut1d
->
lut
[
1
][
i
],
&
lut1d
->
lut
[
2
][
i
])
!=
3
)
if
(
av_
sscanf
(
line
,
"%f %f %f"
,
&
lut1d
->
lut
[
0
][
i
],
&
lut1d
->
lut
[
1
][
i
],
&
lut1d
->
lut
[
2
][
i
])
!=
3
)
return
AVERROR_INVALIDDATA
;
lut1d
->
lut
[
0
][
i
]
*=
max
[
0
]
-
min
[
0
];
lut1d
->
lut
[
1
][
i
]
*=
max
[
1
]
-
min
[
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