History

indeo4: Check the inherited quant_mat

Invalidate it if not supported.

Luca Barbato committed 13 years ago

Commit c9ef6b01 parent 0cb83c51 file · +12 −6Browse files

Unified · Split

libavcodec/indeo4.c+12−6
@@ -370,13 +370,15 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, · 369 unmodified lines
370370 band->scan = scan_index_to_tab[scan_indx];
371371
372372 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− }
377373 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;
380382 return AVERROR_INVALIDDATA;
381383 }
382384 } else {
@@ -386,6 +388,10 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, · 3 unmodified lines
386388 "inherited\n");
387389 return AVERROR_INVALIDDATA;
388390 }
391+ if (band->quant_mat < 0) {
392+ av_log(avctx, AV_LOG_ERROR, "Invalid quant_mat inherited\n");
393+ return AVERROR_INVALIDDATA;
394+ }
389395 }
390396
391397 /* decode block huffman codebook */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t