[FFmpeg-cvslog] svq3: Fix memory corruption introduced by automatic thread_count.

Michael Niedermayer git at videolan.org
Sun Jan 1 02:49:37 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan  1 00:39:29 2012 +0100| [099d6813c27faf95257a529aa2c65dfde816a487] | committer: Michael Niedermayer

svq3: Fix memory corruption introduced by automatic thread_count.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=099d6813c27faf95257a529aa2c65dfde816a487
---

 libavcodec/h264.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f6fcc84..9ec8bd9 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -968,7 +968,7 @@ static void init_dequant_tables(H264Context *h){
 int ff_h264_alloc_tables(H264Context *h){
     MpegEncContext * const s = &h->s;
     const int big_mb_num= s->mb_stride * (s->mb_height+1);
-    const int row_mb_num= 2*s->mb_stride*s->avctx->thread_count;
+    const int row_mb_num= 2*s->mb_stride*FFMAX(s->avctx->thread_count, 1);
     int x,y;
 
     FF_ALLOCZ_OR_GOTO(h->s.avctx, h->intra4x4_pred_mode, row_mb_num * 8  * sizeof(uint8_t), fail)



More information about the ffmpeg-cvslog mailing list