summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-08-01 20:01:41 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-08-01 20:01:41 +0000
commit0cc64d3d1c9d95e0549b2c1baac59ab576837abb (patch)
tree94daddd999052e07d721826bf5c173593551fe8c /libavcodec/motion_est.c
parentcdd106899fba4db49d892c3057f176c9437d6d54 (diff)
downloadffmpeg-0cc64d3d1c9d95e0549b2c1baac59ab576837abb.tar.gz
fix assertion failure for mpeg2 encoding
Originally committed as revision 4488 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 89d973d285..d860274f8a 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1891,7 +1891,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
{
if(s->me_method>=ME_EPZS){
int score[8];
- int i, y, range= s->avctx->me_range;
+ int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2);
uint8_t * fcode_tab= s->fcode_tab;
int best_fcode=-1;
int best_score=-10000000;
@@ -1914,11 +1914,9 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
fcode_tab[my + MAX_MV]);
int j;
- if(range){
if(mx >= range || mx < -range ||
my >= range || my < -range)
continue;
- }
for(j=0; j<fcode && j<8; j++){
if(s->pict_type==B_TYPE || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])