av_normalize_sf doesn't properly address case when negative numbers are out of defined range.
av_normalize1_sf doesn't properly address border case when mantis is exactly 0x40000000. This patch solves both of these problems. Signed-off-by: Nedeljko Babic <nedeljko.ba...@imgtec.com> --- libavutil/softfloat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index 8097d28..182e517 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -47,7 +47,7 @@ static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0}; static av_const SoftFloat av_normalize_sf(SoftFloat a){ if(a.mant){ #if 1 - while((a.mant + 0x20000000U)<0x40000000U){ + while((FFABS(a.mant) + 0x20000000U)<0x40000000U){ a.mant += a.mant; a.exp -= 1; } @@ -68,7 +68,7 @@ static av_const SoftFloat av_normalize_sf(SoftFloat a){ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){ #if 1 - if((int32_t)(a.mant + 0x40000000U) < 0){ + if((int32_t)(a.mant + 0x40000000U) <= 0){ a.exp++; a.mant>>=1; } -- 1.8.2.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel