diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 1d0fb3774e..38eca42476 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -795,6 +795,11 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le for (j = 0; j < 16; j++) sign_bits[j] = get_bits1 (gb); + if (q->coding_method[0][sb][0] <= 0) { + av_log(NULL, AV_LOG_ERROR, "coding method invalid\n"); + return AVERROR_INVALIDDATA; + } + for (j = 0; j < 64; j++) if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j]) q->coding_method[0][sb][j] = q->coding_method[1][sb][j];