+ //The minimum size is 2bit per macroblock
+ // hqx_decode_422 & hqx_decode_444 have a unconditionally stored 4bits hqx_quants index
+ // hqx_decode_422a & hqx_decode_444a use cbp_vlc which has a minimum length of 2 bits for its VLCs
+ // The code rejects slices overlapping in their input data
+ if (avctx->coded_width / 16 * (avctx->coded_height / 16) *
+ (100 - avctx->discard_damaged_percentage) / 100 > 4LL * avpkt->size)
+ return AVERROR_INVALIDDATA;
+