changeset 1818:3ea589261c6e libavcodec

check if threads_count is too large
author michael
date Wed, 18 Feb 2004 16:26:16 +0000
parents 93029a89c173
children 34cdcb221665
files mpegvideo.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Wed Feb 18 15:17:54 2004 +0000
+++ b/mpegvideo.c	Wed Feb 18 16:26:16 2004 +0000
@@ -886,6 +886,11 @@
         return -1;
     }
     
+    if(s->avctx->thread_count > MAX_THREADS || 16*s->avctx->thread_count > s->height){
+        av_log(avctx, AV_LOG_ERROR, "too many threads\n");
+        return -1;
+    }
+    
     if(s->avctx->thread_count > 1)
         s->rtp_mode= 1;