mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
b frame segfault fix
Originally committed as revision 1400 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
b17d099db4
commit
4a711c33cc
@ -1309,15 +1309,15 @@ static inline int direct_search(MpegEncContext * s,
|
|||||||
min= FFMIN(s->me.direct_basis_mv[i][0], s->me.direct_basis_mv[i][0] - s->me.co_located_mv[i][0])>>shift;
|
min= FFMIN(s->me.direct_basis_mv[i][0], s->me.direct_basis_mv[i][0] - s->me.co_located_mv[i][0])>>shift;
|
||||||
max+= (2*mb_x + (i& 1))*8 - 1; // +-1 is for the simpler rounding
|
max+= (2*mb_x + (i& 1))*8 - 1; // +-1 is for the simpler rounding
|
||||||
min+= (2*mb_x + (i& 1))*8 + 1;
|
min+= (2*mb_x + (i& 1))*8 + 1;
|
||||||
if(max >= s->width) xmax= s->width - max - 1;
|
xmax= FFMIN(xmax, s->width - max);
|
||||||
if(min < -16 ) xmin= - 32 - min;
|
xmin= FFMAX(xmin, - 16 - min);
|
||||||
|
|
||||||
max= FFMAX(s->me.direct_basis_mv[i][1], s->me.direct_basis_mv[i][1] - s->me.co_located_mv[i][1])>>shift;
|
max= FFMAX(s->me.direct_basis_mv[i][1], s->me.direct_basis_mv[i][1] - s->me.co_located_mv[i][1])>>shift;
|
||||||
min= FFMIN(s->me.direct_basis_mv[i][1], s->me.direct_basis_mv[i][1] - s->me.co_located_mv[i][1])>>shift;
|
min= FFMIN(s->me.direct_basis_mv[i][1], s->me.direct_basis_mv[i][1] - s->me.co_located_mv[i][1])>>shift;
|
||||||
max+= (2*mb_y + (i>>1))*8 - 1; // +-1 is for the simpler rounding
|
max+= (2*mb_y + (i>>1))*8 - 1; // +-1 is for the simpler rounding
|
||||||
min+= (2*mb_y + (i>>1))*8 + 1;
|
min+= (2*mb_y + (i>>1))*8 + 1;
|
||||||
if(max >= s->height) ymax= s->height - max - 1;
|
ymax= FFMIN(ymax, s->height - max);
|
||||||
if(min < -16 ) ymin= - 32 - min;
|
ymin= FFMAX(ymin, - 16 - min);
|
||||||
|
|
||||||
if(s->mv_type == MV_TYPE_16X16) break;
|
if(s->mv_type == MV_TYPE_16X16) break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user