Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-09-13 14:23:45 +0300
committerLimin Wang <lance.lmwang@gmail.com>2021-09-22 04:25:25 +0300
commit4c079636abf059a54b84d3da015dcd8669ef6471 (patch)
tree775e9502f9fec45164213d7fef9c74c270f7cdea /libavcodec
parent45b850f9f57d2c3304148db6e7d1fab1ba8bc016 (diff)
avcodec/dynamic_hdr10_plus: use AVERROR_INVALIDDATA instead of AVERROR(EINVAL)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dynamic_hdr10_plus.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libavcodec/dynamic_hdr10_plus.c b/libavcodec/dynamic_hdr10_plus.c
index a602e606ed..854e70d455 100644
--- a/libavcodec/dynamic_hdr10_plus.c
+++ b/libavcodec/dynamic_hdr10_plus.c
@@ -76,7 +76,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
}
if (get_bits_left(gb) < 28)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
s->targeted_system_display_maximum_luminance =
(AVRational){get_bits_long(gb, 27), luminance_den};
@@ -85,7 +85,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
if (s->targeted_system_display_actual_peak_luminance_flag) {
int rows, cols;
if (get_bits_left(gb) < 10)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
rows = get_bits(gb, 5);
cols = get_bits(gb, 5);
if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) {
@@ -95,7 +95,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
s->num_cols_targeted_system_display_actual_peak_luminance = cols;
if (get_bits_left(gb) < (rows * cols * 4))
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
@@ -107,7 +107,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
for (int w = 0; w < s->num_windows; w++) {
AVHDRPlusColorTransformParams *params = &s->params[w];
if (get_bits_left(gb) < (3 * 17 + 17 + 4))
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
for (int i = 0; i < 3; i++) {
params->maxscl[i] =
@@ -119,7 +119,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
if (get_bits_left(gb) <
(params->num_distribution_maxrgb_percentiles * 24))
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
for (int i = 0; i < params->num_distribution_maxrgb_percentiles; i++) {
params->distribution_maxrgb[i].percentage = get_bits(gb, 7);
@@ -128,17 +128,17 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
}
if (get_bits_left(gb) < 10)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
params->fraction_bright_pixels = (AVRational){get_bits(gb, 10), fraction_pixel_den};
}
if (get_bits_left(gb) < 1)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
s->mastering_display_actual_peak_luminance_flag = get_bits1(gb);
if (s->mastering_display_actual_peak_luminance_flag) {
int rows, cols;
if (get_bits_left(gb) < 10)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
rows = get_bits(gb, 5);
cols = get_bits(gb, 5);
if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) {
@@ -148,7 +148,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
s->num_cols_mastering_display_actual_peak_luminance = cols;
if (get_bits_left(gb) < (rows * cols * 4))
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
@@ -161,12 +161,12 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
for (int w = 0; w < s->num_windows; w++) {
AVHDRPlusColorTransformParams *params = &s->params[w];
if (get_bits_left(gb) < 1)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
params->tone_mapping_flag = get_bits1(gb);
if (params->tone_mapping_flag) {
if (get_bits_left(gb) < 28)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
params->knee_point_x =
(AVRational){get_bits(gb, 12), knee_point_den};
@@ -175,7 +175,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
params->num_bezier_curve_anchors = get_bits(gb, 4);
if (get_bits_left(gb) < (params->num_bezier_curve_anchors * 10))
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
for (int i = 0; i < params->num_bezier_curve_anchors; i++) {
params->bezier_curve_anchors[i] =
@@ -184,11 +184,11 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t
}
if (get_bits_left(gb) < 1)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
params->color_saturation_mapping_flag = get_bits1(gb);
if (params->color_saturation_mapping_flag) {
if (get_bits_left(gb) < 6)
- return AVERROR(EINVAL);
+ return AVERROR_INVALIDDATA;
params->color_saturation_weight =
(AVRational){get_bits(gb, 6), saturation_weight_den};
}