diff options
author | Clément Bœsch <u@pkh.me> | 2017-04-08 14:41:10 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-04-08 14:41:10 +0200 |
commit | 883fe17e3bef8ae176876273bef6b7a81f413bc7 (patch) | |
tree | 929cb44a0476c80110624ca14029214192f0c0c3 /libavcodec/h264_ps.c | |
parent | 5be1440c74d017b935a447b4dc979b7bb11f6aff (diff) | |
parent | ff9db5cfd14558df9cfcc54d6c062bc34bf1f341 (diff) | |
download | ffmpeg-883fe17e3bef8ae176876273bef6b7a81f413bc7.tar.gz |
Merge commit 'ff9db5cfd14558df9cfcc54d6c062bc34bf1f341'
* commit 'ff9db5cfd14558df9cfcc54d6c062bc34bf1f341':
lavc: Use a stricter check for the color properties values
Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavcodec/h264_ps.c')
-rw-r--r-- | libavcodec/h264_ps.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 7e66ed7224..785836123e 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -168,11 +168,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; } } |