diff mbox series

[FFmpeg-devel,major,bump,5/6] avcodec/dynamic_hdr_vivid: reindent after the previous commit

Message ID tencent_A5AB424EC370342DDA9ABD40C79A1B9F9508@qq.com
State New
Headers show
Series [FFmpeg-devel,major,bump,1/6] libavutil/hdr_dynamic_vivid_metadata: fix AVHDRVividColorToneMappingParams | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili Feb. 2, 2023, 7:02 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

---
 libavcodec/dynamic_hdr_vivid.c | 38 +++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 19 deletions(-)
diff mbox series

Patch

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};
                         }
+                    }
                 }
             }