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
ff9db5cf
Commit
ff9db5cf
authored
Nov 30, 2016
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: Use a stricter check for the color properties values
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
0a35f128
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
h264_ps.c
libavcodec/h264_ps.c
+5
-3
hevc_ps.c
libavcodec/hevc_ps.c
+3
-3
No files found.
libavcodec/h264_ps.c
View file @
ff9db5cf
...
...
@@ -191,11 +191,13 @@ static inline int decode_vui_parameters(GetBitContext *gb, AVCodecContext *avctx
sps
->
color_primaries
=
get_bits
(
gb
,
8
);
/* colour_primaries */
sps
->
color_trc
=
get_bits
(
gb
,
8
);
/* transfer_characteristics */
sps
->
colorspace
=
get_bits
(
gb
,
8
);
/* matrix_coefficients */
if
(
sps
->
color_primaries
>=
AVCOL_PRI_NB
)
// Set invalid values to "unspecified"
if
(
!
av_color_primaries_name
(
sps
->
color_primaries
))
sps
->
color_primaries
=
AVCOL_PRI_UNSPECIFIED
;
if
(
sps
->
color_trc
>=
AVCOL_TRC_NB
)
if
(
!
av_color_transfer_name
(
sps
->
color_trc
)
)
sps
->
color_trc
=
AVCOL_TRC_UNSPECIFIED
;
if
(
sps
->
colorspace
>=
AVCOL_SPC_NB
)
if
(
!
av_color_space_name
(
sps
->
colorspace
)
)
sps
->
colorspace
=
AVCOL_SPC_UNSPECIFIED
;
}
}
...
...
libavcodec/hevc_ps.c
View file @
ff9db5cf
...
...
@@ -497,11 +497,11 @@ static void decode_vui(GetBitContext *gb, AVCodecContext *avctx,
vui
->
matrix_coeffs
=
get_bits
(
gb
,
8
);
// Set invalid values to "unspecified"
if
(
vui
->
colour_primaries
>=
AVCOL_PRI_NB
)
if
(
!
av_color_primaries_name
(
vui
->
colour_primaries
)
)
vui
->
colour_primaries
=
AVCOL_PRI_UNSPECIFIED
;
if
(
vui
->
transfer_characteristic
>=
AVCOL_TRC_NB
)
if
(
!
av_color_transfer_name
(
vui
->
transfer_characteristic
)
)
vui
->
transfer_characteristic
=
AVCOL_TRC_UNSPECIFIED
;
if
(
vui
->
matrix_coeffs
>=
AVCOL_SPC_NB
)
if
(
!
av_color_space_name
(
vui
->
matrix_coeffs
)
)
vui
->
matrix_coeffs
=
AVCOL_SPC_UNSPECIFIED
;
}
}
...
...
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