Invalidate it if not supported.
Unified · Split
| @@ -370,13 +370,15 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, · 369 unmodified lines | |||
| 370 | band->scan = scan_index_to_tab[scan_indx]; | 370 | band->scan = scan_index_to_tab[scan_indx]; |
| 371 | 371 | ||
| 372 | band->quant_mat = get_bits(&ctx->gb, 5); | 372 | band->quant_mat = get_bits(&ctx->gb, 5); |
| 373 | if (band->quant_mat == 31) { | ||
| 374 | av_log(avctx, AV_LOG_ERROR, "Custom quant matrix encountered!\n"); | ||
| 375 | return AVERROR_INVALIDDATA; | ||
| 376 | } | ||
| 377 | if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) { | 373 | if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) { |
| 378 | avpriv_request_sample(avctx, "Quantization matrix %d", | 374 | |
| 379 | band->quant_mat); | 375 | if (band->quant_mat == 31) |
| 376 | av_log(avctx, AV_LOG_ERROR, | ||
| 377 | "Custom quant matrix encountered!\n"); | ||
| 378 | else | ||
| 379 | avpriv_request_sample(avctx, "Quantization matrix %d", | ||
| 380 | band->quant_mat); | ||
| 381 | band->quant_mat = -1; | ||
| 380 | return AVERROR_INVALIDDATA; | 382 | return AVERROR_INVALIDDATA; |
| 381 | } | 383 | } |
| 382 | } else { | 384 | } else { |
| @@ -386,6 +388,10 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, · 3 unmodified lines | |||
| 386 | "inherited\n"); | 388 | "inherited\n"); |
| 387 | return AVERROR_INVALIDDATA; | 389 | return AVERROR_INVALIDDATA; |
| 388 | } | 390 | } |
| 391 | if (band->quant_mat < 0) { | ||
| 392 | av_log(avctx, AV_LOG_ERROR, "Invalid quant_mat inherited\n"); | ||
| 393 | return AVERROR_INVALIDDATA; | ||
| 394 | } | ||
| 389 | } | 395 | } |
| 390 | 396 | ||
| 391 | /* decode block huffman codebook */ | 397 | /* decode block huffman codebook */ |