comparison utils.c @ 9536:f522c8e05a29 libavcodec

Update safety check as the maximum pixel size is no longer 4. New max size is 16bit * 4 samples (RGBA).
author michael
date Wed, 22 Apr 2009 01:54:05 +0000
parents 141badec76fc
children 59073f92f0e2
comparison
equal deleted inserted replaced
9535:4a4929da4ddc 9536:f522c8e05a29
198 if(s->codec_id == CODEC_ID_H264) 198 if(s->codec_id == CODEC_ID_H264)
199 *height+=2; // some of the optimized chroma MC reads one line too much 199 *height+=2; // some of the optimized chroma MC reads one line too much
200 } 200 }
201 201
202 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){ 202 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
203 if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/4) 203 if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
204 return 0; 204 return 0;
205 205
206 av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h); 206 av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
207 return -1; 207 return -1;
208 } 208 }