]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Allocate 1 line more in the chroma plane for H.264, this avoids some
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 30 Sep 2008 01:45:53 +0000 (01:45 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 30 Sep 2008 01:45:53 +0000 (01:45 +0000)
out of array reads with mmx/sse2 code.
Fixes issue327.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15467 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/utils.c

index 66122a5c9f765ad4e4b819ea3ea3375195f73889..cf406817596ad9febd4a5ec889d51ada9adbc944 100644 (file)
@@ -170,6 +170,8 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
 
     *width = ALIGN(*width , w_align);
     *height= ALIGN(*height, h_align);
+    if(s->codec_id == CODEC_ID_H264)
+        *height+=2; // some of the optimized chroma MC reads one line too much
 }
 
 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){