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

Marton Balint cus at passwd.hu
Mon May 4 22:34:36 EEST 2020



On Mon, 4 May 2020, lance.lmwang at gmail.com wrote:

> On Mon, May 04, 2020 at 05:50:32AM +0800, lance.lmwang at gmail.com wrote:
>> 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
>> 
>
> will apply tomorrow.

LGTM, thanks.

Marton


More information about the ffmpeg-devel mailing list