summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-18 16:26:16 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-18 16:26:16 +0000
commitfbf2284cd242e4d2b1051bc760e6393c0897b080 (patch)
treed3d15604bf130ccfd6aa33a166639db722c23817 /libavcodec/mpegvideo.c
parent1e31d32c345c43bb12890c8d0e0ca1316d85ed2d (diff)
check if threads_count is too large
Originally committed as revision 2798 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index db46596862..1f8455a47c 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -886,6 +886,11 @@ int MPV_encode_init(AVCodecContext *avctx)
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;