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
f9987464
Commit
f9987464
authored
Feb 26, 2016
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sws/yuv2rgb: avoid a few ub on signed left shifts
parent
5156578d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
yuv2rgb.c
libswscale/yuv2rgb.c
+10
-10
No files found.
libswscale/yuv2rgb.c
View file @
f9987464
...
@@ -824,18 +824,18 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
...
@@ -824,18 +824,18 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
c
->
ugCoeff
=
roundToInt16
(
cgu
*
8192
)
*
0x0001000100010001ULL
;
c
->
ugCoeff
=
roundToInt16
(
cgu
*
8192
)
*
0x0001000100010001ULL
;
c
->
yOffset
=
roundToInt16
(
oy
*
8
)
*
0x0001000100010001ULL
;
c
->
yOffset
=
roundToInt16
(
oy
*
8
)
*
0x0001000100010001ULL
;
c
->
yuv2rgb_y_coeff
=
(
int16_t
)
roundToInt16
(
cy
<<
13
);
c
->
yuv2rgb_y_coeff
=
(
int16_t
)
roundToInt16
(
cy
*
(
1
<<
13
)
);
c
->
yuv2rgb_y_offset
=
(
int16_t
)
roundToInt16
(
oy
<<
9
);
c
->
yuv2rgb_y_offset
=
(
int16_t
)
roundToInt16
(
oy
*
(
1
<<
9
)
);
c
->
yuv2rgb_v2r_coeff
=
(
int16_t
)
roundToInt16
(
crv
<<
13
);
c
->
yuv2rgb_v2r_coeff
=
(
int16_t
)
roundToInt16
(
crv
*
(
1
<<
13
)
);
c
->
yuv2rgb_v2g_coeff
=
(
int16_t
)
roundToInt16
(
cgv
<<
13
);
c
->
yuv2rgb_v2g_coeff
=
(
int16_t
)
roundToInt16
(
cgv
*
(
1
<<
13
)
);
c
->
yuv2rgb_u2g_coeff
=
(
int16_t
)
roundToInt16
(
cgu
<<
13
);
c
->
yuv2rgb_u2g_coeff
=
(
int16_t
)
roundToInt16
(
cgu
*
(
1
<<
13
)
);
c
->
yuv2rgb_u2b_coeff
=
(
int16_t
)
roundToInt16
(
cbu
<<
13
);
c
->
yuv2rgb_u2b_coeff
=
(
int16_t
)
roundToInt16
(
cbu
*
(
1
<<
13
)
);
//scale coefficients by cy
//scale coefficients by cy
crv
=
((
crv
<<
16
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
crv
=
((
crv
*
(
1
<<
16
)
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
cbu
=
((
cbu
<<
16
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
cbu
=
((
cbu
*
(
1
<<
16
)
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
cgu
=
((
cgu
<<
16
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
cgu
=
((
cgu
*
(
1
<<
16
)
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
cgv
=
((
cgv
<<
16
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
cgv
=
((
cgv
*
(
1
<<
16
)
)
+
0x8000
)
/
FFMAX
(
cy
,
1
);
av_freep
(
&
c
->
yuvTable
);
av_freep
(
&
c
->
yuvTable
);
...
...
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