Invalidate it if not supported.
Unified · Split
| @@ -370,13 +370,15 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, · 369 unmodified lines | ||
| 370 | 370 | band->scan = scan_index_to_tab[scan_indx]; |
| 371 | 371 | |
| 372 | 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 | 373 | if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) { |
| 378 | − avpriv_request_sample(avctx, "Quantization matrix %d", | |
| 379 | − band->quant_mat); | |
| 374 | + | |
| 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 | 382 | return AVERROR_INVALIDDATA; |
| 381 | 383 | } |
| 382 | 384 | } else { |
| @@ -386,6 +388,10 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, · 3 unmodified lines | ||
| 386 | 388 | "inherited\n"); |
| 387 | 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 | 397 | /* decode block huffman codebook */ |