diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 677c33d78f..504f60f526 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -467,6 +467,11 @@ static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile } if (cbp & 1) { /* block coded ? */ + if (!band->scan) { + av_log(avctx, AV_LOG_ERROR, "Scan pattern is not set.\n"); + return AVERROR_INVALIDDATA; + } + scan_pos = -1; memset(trvec, 0, num_coeffs*sizeof(trvec[0])); /* zero transform vector */ memset(col_flags, 0, sizeof(col_flags)); /* zero column flags */