diff mbox

[FFmpeg-devel,1/2] avcodec/exr: fix invalid shift in unpack_14()

Message ID 20180221032945.29394-1-michael@niedermayer.cc
State Accepted
Commit 49062a90174b6e4104876c0257dc673a0da854ca
Headers show

Commit Message

Michael Niedermayer Feb. 21, 2018, 3:29 a.m. UTC
Fixes: 6154/clusterfuzz-testcase-minimized-5762231061970944
Fixes: runtime error: shift exponent 63 is too large for 32-bit type 'int'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/exr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Feb. 27, 2018, 6:13 p.m. UTC | #1
On Wed, Feb 21, 2018 at 04:29:44AM +0100, Michael Niedermayer wrote:
> Fixes: 6154/clusterfuzz-testcase-minimized-5762231061970944
> Fixes: runtime error: shift exponent 63 is too large for 32-bit type 'int'
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/exr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox

Patch

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 47f59bd638..ff31d7267c 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -899,7 +899,7 @@  static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
 
 static void unpack_14(const uint8_t b[14], uint16_t s[16])
 {
-    unsigned short shift = (b[ 2] >> 2);
+    unsigned short shift = (b[ 2] >> 2) & 15;
     unsigned short bias = (0x20 << shift);
     int i;