mlpdec: check for negative index

Message ID 20141113004711.5B9AE5DFCA@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau Nov. 13, 2014, 12:47 a.m.
Module: libav
Branch: master
Commit: 2ffb0598dbdb81c40650952aa9299fa02fa5e834

Author:    Vittorio Giovara <vittorio.giovara@gmail.com>
Committer: Vittorio Giovara <vittorio.giovara@gmail.com>
Date:      Tue Nov 11 17:40:06 2014 +0100

mlpdec: check for negative index

CC: libav-stable@libav.org
Bug-Id: CID 970924

---

 libavcodec/mlpdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 6baf4c1..624efc1 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -552,7 +552,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
             ch_assign = av_get_channel_layout_channel_index(s->ch_layout,
                                                             channel);
         }
-        if (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);