[FFmpeg-cvslog] libavcodec/exr : fix float to uint16 conversion for negative float value

Martin Vignali git at videolan.org
Thu Apr 27 05:27:55 EEST 2017


ffmpeg | branch: master | Martin Vignali <martin.vignali at gmail.com> | Tue Apr 25 22:52:50 2017 +0200| [e46d63745215c04637e7797228bad36bce49d881] | committer: Michael Niedermayer

libavcodec/exr : fix float to uint16 conversion for negative float value

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e46d63745215c04637e7797228bad36bce49d881
---

 libavcodec/exr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 71946400c5..c32eea1b8f 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -220,9 +220,9 @@ static union av_intfloat32 exr_half2float(uint16_t hf)
  *
  * @return normalized 16-bit unsigned int
  */
-static inline uint16_t exr_flt2uint(uint32_t v)
+static inline uint16_t exr_flt2uint(int32_t v)
 {
-    unsigned int exp = v >> 23;
+    int32_t exp = v >> 23;
     // "HACK": negative values result in exp<  0, so clipping them to 0
     // is also handled by this condition, avoids explicit check for sign bit.
     if (exp <= 127 + 7 - 24) // we would shift out all bits anyway



More information about the ffmpeg-cvslog mailing list