changeset 9561:20c79ce2cd5e libavcodec

Make sure we only parse max amount of subpackets (5) in the cook decoder.
author banan
date Sat, 25 Apr 2009 17:46:27 +0000
parents 030eefed0f5c
children 9ee33a9bf944
files cook.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cook.c	Sat Apr 25 17:35:21 2009 +0000
+++ b/cook.c	Sat Apr 25 17:46:27 2009 +0000
@@ -1219,6 +1219,10 @@
 
         q->num_subpackets++;
         s++;
+        if (s > MAX_SUBPACKETS) {
+            av_log(avctx,AV_LOG_ERROR,"Too many subpackets > 5, report file!\n");
+            return -1;
+        }
     }
     /* Generate tables */
     init_pow2table();