| @@ -450,14 +450,6 @@ static void hevc_vps_free(AVRefStructOpaque opaque, void *obj) · 449 unmodified lines |
| 450 | av_freep(&vps->data); | 450 | av_freep(&vps->data); |
| 451 | } | 451 | } |
| 452 | | 452 | |
| 453 | enum ScalabilityMask { | | |
| 454 | HEVC_SCALABILITY_DEPTH = 0, | | |
| 455 | HEVC_SCALABILITY_MULTIVIEW = 1, | | |
| 456 | HEVC_SCALABILITY_SPATIAL = 2, | | |
| 457 | HEVC_SCALABILITY_AUXILIARY = 3, | | |
| 458 | HEVC_SCALABILITY_MASK_MAX = 15, | | |
| 459 | }; | | |
| 460 | | | |
| 461 | enum DependencyType { | 453 | enum DependencyType { |
| 462 | HEVC_DEP_TYPE_SAMPLE = 0, | 454 | HEVC_DEP_TYPE_SAMPLE = 0, |
| 463 | HEVC_DEP_TYPE_MV = 1, | 455 | HEVC_DEP_TYPE_MV = 1, |
| @@ -532,17 +524,22 @@ static int decode_vps_ext(GetBitContext *gb, AVCodecContext *avctx, HEVCVPS *vps · 68 unmodified lines |
| 532 | return AVERROR_INVALIDDATA; | 524 | return AVERROR_INVALIDDATA; |
| 533 | | 525 | |
| 534 | splitting_flag = get_bits1(gb); | 526 | splitting_flag = get_bits1(gb); |
| 535 | num_scalability_types = 0; | 527 | vps->scalability_mask_flag = get_bits(gb, 16); |
| 536 | for (int i = 0; i <= HEVC_SCALABILITY_MASK_MAX; i++) { | 528 | num_scalability_types = av_popcount(vps->scalability_mask_flag); |
| 537 | int scalability_mask_flag = get_bits1(gb); | 529 | if (!num_scalability_types) { |
| 538 | if (scalability_mask_flag && (i != HEVC_SCALABILITY_MULTIVIEW)) { | 530 | av_log(avctx, AV_LOG_ERROR, "Missing scalability mask\n"); |
| 539 | av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n", i); | | |
| 540 | return AVERROR_PATCHWELCOME; | | |
| 541 | } | | |
| 542 | num_scalability_types += scalability_mask_flag; | | |
| 543 | } | | |
| 544 | if (num_scalability_types != 1) | | |
| 545 | return AVERROR_INVALIDDATA; | 531 | return AVERROR_INVALIDDATA; |
| | 532 | } else if (num_scalability_types > 1) { |
| | 533 | av_log(avctx, AV_LOG_ERROR, "Scalability number %d not supported\n", |
| | 534 | num_scalability_types); |
| | 535 | return AVERROR_PATCHWELCOME; |
| | 536 | } |
| | 537 | |
| | 538 | if (!(vps->scalability_mask_flag & HEVC_SCALABILITY_MULTIVIEW)) { |
| | 539 | av_log(avctx, AV_LOG_ERROR, "Scalability type %d not supported\n", |
| | 540 | 15 - ff_ctz(vps->scalability_mask_flag)); |
| | 541 | return AVERROR_PATCHWELCOME; |
| | 542 | } |
| 546 | | 543 | |
| 547 | if (!splitting_flag) | 544 | if (!splitting_flag) |
| 548 | dimension_id_len = get_bits(gb, 3) + 1; | 545 | dimension_id_len = get_bits(gb, 3) + 1; |