[FFmpeg-devel] [PATCH] avcodec/prores_metadata_bsf: Use AVCOL_TRC_NB - 1 for the valid max range

lance.lmwang at gmail.com lance.lmwang at gmail.com
Mon May 4 00:50:32 EEST 2020


From: Limin Wang <lance.lmwang at gmail.com>

Report by Marton after commit.

Reviewed-by: Marton Balint <cus at passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavcodec/prores_metadata_bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/prores_metadata_bsf.c b/libavcodec/prores_metadata_bsf.c
index 8bfcb50..7cc2320 100644
--- a/libavcodec/prores_metadata_bsf.c
+++ b/libavcodec/prores_metadata_bsf.c
@@ -140,7 +140,7 @@ static const AVOption options[] = {
     {"smpte431",                        NULL,  0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_SMPTE431},     INT_MIN, INT_MAX, FLAGS, "color_primaries"},
     {"smpte432",                        NULL,  0, AV_OPT_TYPE_CONST, {.i64=AVCOL_PRI_SMPTE432},     INT_MIN, INT_MAX, FLAGS, "color_primaries"},
 
-    {"color_trc", "select color transfer", OFFSET(transfer_characteristics), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_TRC_NB, FLAGS, "color_trc"},
+    {"color_trc", "select color transfer", OFFSET(transfer_characteristics), AV_OPT_TYPE_INT, {.i64=-1}, -1, AVCOL_TRC_NB - 1, FLAGS, "color_trc"},
     {"auto", "keep the same color transfer",  0, AV_OPT_TYPE_CONST, {.i64=-1},                               INT_MIN, INT_MAX, FLAGS, "color_trc"},
     {"unknown",                        NULL,  0, AV_OPT_TYPE_CONST, {.i64=0},                                INT_MIN, INT_MAX, FLAGS, "color_trc"},
     {"bt709",                          NULL,  0, AV_OPT_TYPE_CONST, {.i64=AVCOL_TRC_BT709},                  INT_MIN, INT_MAX, FLAGS, "color_trc"},
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list