From 43c462f6a4920b82aeb0a22bb6f9c334b9614f96 Mon Sep 17 00:00:00 2001
From: Daniel Kang <daniel.d.kang@gmail.com>
Date: Sun, 9 Jan 2011 18:50:28 -0500
Subject: [PATCH] Check for invalid indeo sym value

---
 libavcodec/ivi_common.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index b158458..81e01a7 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -404,8 +404,12 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
                         hi  = get_vlc2(gb, band->blk_vlc.tab->table, IVI_VLC_BITS, 1);
                         val = IVI_TOSIGNED((hi << 6) | lo); /* merge them and convert into signed val */
                     } else {
-                        run = rvmap->runtab[sym];
-                        val = rvmap->valtab[sym];
+                        if (sym < 0 || sym >= 256)
+                            av_log(NULL, AV_LOG_ERROR, "Invalid sym encountered.\n");
+                        else {
+                            run = rvmap->runtab[sym];
+                            val = rvmap->valtab[sym];
+                        }
                     }

                     /* de-zigzag and dequantize */
--
1.7.2.2
