[FFmpeg-devel] [PATCH major bump 5/6] avcodec/dynamic_hdr_vivid: reindent after the previous commit
Zhao Zhili
quinkblack at foxmail.com
Thu Feb 2 09:02:07 EET 2023
From: Zhao Zhili <zhilizhao at tencent.com>
---
libavcodec/dynamic_hdr_vivid.c | 38 +++++++++++++++++-----------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/libavcodec/dynamic_hdr_vivid.c b/libavcodec/dynamic_hdr_vivid.c
index 4ebcc3f4c1..710f9dd9c6 100644
--- a/libavcodec/dynamic_hdr_vivid.c
+++ b/libavcodec/dynamic_hdr_vivid.c
@@ -92,28 +92,28 @@ int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t
tm_params->base_param_Delta_enable_mode = get_bits(gb, 3);
tm_params->base_param_Delta = (AVRational){get_bits(gb, 7), base_param_Delta_den};
}
- if (get_bits_left(gb) < 1)
+ if (get_bits_left(gb) < 1)
+ return AVERROR_INVALIDDATA;
+ tm_params->three_Spline_enable_flag = get_bits(gb, 1);
+ if (tm_params->three_Spline_enable_flag) {
+ if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
+ return AVERROR_INVALIDDATA;
+ tm_params->three_Spline_num = get_bits(gb, 1) + 1;
+ if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_Spline_TH_mode))
return AVERROR_INVALIDDATA;
- tm_params->three_Spline_enable_flag = get_bits(gb, 1);
- if (tm_params->three_Spline_enable_flag) {
- if (get_bits_left(gb) < 1 + tm_params->three_Spline_num * (2 + 12 + 28 + 1))
- return AVERROR_INVALIDDATA;
- tm_params->three_Spline_num = get_bits(gb, 1) + 1;
- if (tm_params->three_Spline_num > FF_ARRAY_ELEMS(tm_params->three_Spline_TH_mode))
- return AVERROR_INVALIDDATA;
- for (int j = 0; j < tm_params->three_Spline_num; j++) {
- tm_params->three_Spline_TH_mode[j] = get_bits(gb, 2);
- if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
- if (get_bits_left(gb) < 8)
- return AVERROR_INVALIDDATA;
- tm_params->three_Spline_TH_enable_MB[j] = (AVRational){get_bits(gb, 8), 255};
- }
- tm_params->three_Spline_TH_enable[j] = (AVRational){get_bits(gb, 12), 4095};
- tm_params->three_Spline_TH_Delta1[j] = (AVRational){get_bits(gb, 10), 1023};
- tm_params->three_Spline_TH_Delta2[j] = (AVRational){get_bits(gb, 10), 1023};
- tm_params->three_Spline_enable_Strength[j] = (AVRational){get_bits(gb, 8), 255};
+ for (int j = 0; j < tm_params->three_Spline_num; j++) {
+ tm_params->three_Spline_TH_mode[j] = get_bits(gb, 2);
+ if (tm_params->three_Spline_TH_mode[j] == 0 || tm_params->three_Spline_TH_mode[j] == 2) {
+ if (get_bits_left(gb) < 8)
+ return AVERROR_INVALIDDATA;
+ tm_params->three_Spline_TH_enable_MB[j] = (AVRational){get_bits(gb, 8), 255};
}
+ tm_params->three_Spline_TH_enable[j] = (AVRational){get_bits(gb, 12), 4095};
+ tm_params->three_Spline_TH_Delta1[j] = (AVRational){get_bits(gb, 10), 1023};
+ tm_params->three_Spline_TH_Delta2[j] = (AVRational){get_bits(gb, 10), 1023};
+ tm_params->three_Spline_enable_Strength[j] = (AVRational){get_bits(gb, 8), 255};
}
+ }
}
}
--
2.25.1
More information about the ffmpeg-devel
mailing list