# HG changeset patch # User lorenm # Date 1138409879 0 # Node ID 3c32ecc8eefed6a78c1e17bbfbdf92b42ccec178 # Parent 1363655b443c95ca356295a6786e1d1ec41232d7 fix crash on height < 16 pixels. diff -r 1363655b443c -r 3c32ecc8eefe mpegvideo.c --- a/mpegvideo.c Fri Jan 27 23:24:24 2006 +0000 +++ b/mpegvideo.c Sat Jan 28 00:57:59 2006 +0000 @@ -613,7 +613,9 @@ { int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; - if(s->avctx->thread_count > MAX_THREADS || (16*s->avctx->thread_count > s->height && s->height)){ + s->mb_height = (s->height + 15) / 16; + + if(s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height)){ av_log(s->avctx, AV_LOG_ERROR, "too many threads\n"); return -1; } @@ -628,7 +630,6 @@ s->flags2= s->avctx->flags2; s->mb_width = (s->width + 15) / 16; - s->mb_height = (s->height + 15) / 16; s->mb_stride = s->mb_width + 1; s->b8_stride = s->mb_width*2 + 1; s->b4_stride = s->mb_width*4 + 1;