comparison utils.c @ 7942:64f35acc2407 libavcodec

Allocate 1 line more in the chroma plane for H.264, this avoids some out of array reads with mmx/sse2 code. Fixes issue327.
author michael
date Tue, 30 Sep 2008 01:45:53 +0000
parents 8a3f24796fa9
children 47f50599b368
comparison
equal deleted inserted replaced
7941:8a3f24796fa9 7942:64f35acc2407
168 break; 168 break;
169 } 169 }
170 170
171 *width = ALIGN(*width , w_align); 171 *width = ALIGN(*width , w_align);
172 *height= ALIGN(*height, h_align); 172 *height= ALIGN(*height, h_align);
173 if(s->codec_id == CODEC_ID_H264)
174 *height+=2; // some of the optimized chroma MC reads one line too much
173 } 175 }
174 176
175 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){ 177 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
176 if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4) 178 if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4)
177 return 0; 179 return 0;