aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-10-03 14:47:30 -0300
committerJames Almer <jamrial@gmail.com>2024-10-05 14:36:04 -0300
commit32e34692fb779844a11d7be2d9b6114e93af67a5 (patch)
tree1c4a9b514fd2c101d6a424e44292d92e3514ab99
parent099f88b8641dfc299f3896d17d9addc5b9ae7799 (diff)
downloadffmpeg-32e34692fb779844a11d7be2d9b6114e93af67a5.tar.gz
avcodec/hevc/ps: print the correct unsupported scalability value found
With multilayer001.heic, which signals Spatial scalability: Before: [hevc @ ...] Scalability type 1 not supported [hevc @ ...] Ignoring unsupported VPS extension After: [hevc @ ...] Scalability type 2 not supported [hevc @ ...] Ignoring unsupported VPS extension Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/hevc/ps.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
index f18b88489b..3fc14c1e72 100644
--- a/libavcodec/hevc/ps.c
+++ b/libavcodec/hevc/ps.c
@@ -470,7 +470,7 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps
PTL ptl_dummy;
uint8_t max_sub_layers[HEVC_MAX_LAYERS];
- int splitting_flag, dimension_id_len, view_id_len, num_add_olss,
+ int splitting_flag, dimension_id_len, view_id_len, num_add_olss, num_scalability_types,
default_output_layer_idc, direct_dep_type_len, direct_dep_type,
sub_layers_max_present, sub_layer_flag_info_present_flag, nb_ptl;
unsigned non_vui_extension_length;
@@ -532,13 +532,17 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps
return AVERROR_INVALIDDATA;
splitting_flag = get_bits1(gb);
+ num_scalability_types = 0;
for (int i = 0; i <= HEVC_SCALABILITY_MASK_MAX; i++) {
int scalability_mask_flag = get_bits1(gb);
- if (scalability_mask_flag != (i == HEVC_SCALABILITY_MULTIVIEW)) {
+ if (scalability_mask_flag && (i != HEVC_SCALABILITY_MULTIVIEW)) {
av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n", i);
return AVERROR_PATCHWELCOME;
}
+ num_scalability_types += scalability_mask_flag;
}
+ if (num_scalability_types != 1)
+ return AVERROR_INVALIDDATA;
if (!splitting_flag)
dimension_id_len = get_bits(gb, 3) + 1;