changeset 5928:de81a7e065fc libavcodec

check region depth for validity (32/64/128 would crash at least due to 1<<depth allocation later, and no i do not have a sample file)
author michael
date Mon, 19 Nov 2007 20:14:46 +0000
parents 2fa5d656af8e
children aaeed46a74fd
files dvbsubdec.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dvbsubdec.c	Sun Nov 18 10:54:38 2007 +0000
+++ b/dvbsubdec.c	Mon Nov 19 20:14:46 2007 +0000
@@ -1035,6 +1035,10 @@
     }
 
     region->depth = 1 << (((*buf++) >> 2) & 7);
+    if(region->depth<2 || region->depth>8){
+        av_log(avctx, AV_LOG_ERROR, "region depth %d is invalid\n", region->depth);
+        region->depth= 4;
+    }
     region->clut = *buf++;
 
     if (region->depth == 8)