diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index d26c27777e..490d107e78 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -583,7 +583,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ch_assign = av_get_channel_layout_channel_index(s->ch_layout, channel); } - if ((unsigned)ch_assign > s->max_matrix_channel) { + if (ch_assign < 0 || ch_assign > s->max_matrix_channel) { avpriv_request_sample(m->avctx, "Assignment of matrix channel %d to invalid output channel %d", ch, ch_assign);