[FFmpeg-cvslog] r11062 - trunk/libavcodec/dvbsubdec.c

michael subversion
Mon Nov 19 21:14:47 CET 2007


Author: michael
Date: Mon Nov 19 21:14:46 2007
New Revision: 11062

Log:
check region depth for validity
(32/64/128 would crash at least due to 1<<depth allocation later, and no i dont have
a sample file)


Modified:
   trunk/libavcodec/dvbsubdec.c

Modified: trunk/libavcodec/dvbsubdec.c
==============================================================================
--- trunk/libavcodec/dvbsubdec.c	(original)
+++ trunk/libavcodec/dvbsubdec.c	Mon Nov 19 21:14:46 2007
@@ -1035,6 +1035,10 @@ static void dvbsub_parse_region_segment(
     }
 
     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)




More information about the ffmpeg-cvslog mailing list