Browse code

fix assertion failure for mpeg2 encoding

Originally committed as revision 4488 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2005/08/02 05:01:41
Showing 1 changed files
... ...
@@ -1891,7 +1891,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
1891 1891
 {
1892 1892
     if(s->me_method>=ME_EPZS){
1893 1893
         int score[8];
1894
-        int i, y, range= s->avctx->me_range;
1894
+        int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2);
1895 1895
         uint8_t * fcode_tab= s->fcode_tab;
1896 1896
         int best_fcode=-1;
1897 1897
         int best_score=-10000000;
... ...
@@ -1914,11 +1914,9 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
1914 1914
                                      fcode_tab[my + MAX_MV]);
1915 1915
                     int j;
1916 1916
                     
1917
-                    if(range){
1918 1917
                         if(mx >= range || mx < -range || 
1919 1918
                            my >= range || my < -range)
1920 1919
                             continue;
1921
-                    }
1922 1920
                     
1923 1921
                     for(j=0; j<fcode && j<8; j++){
1924 1922
                         if(s->pict_type==B_TYPE || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])