Opened 5 years ago

Closed 4 years ago

#8146 closed defect (fixed)

left shift of negative value bug in libswscale/input.c

Reported by: Suhwan Owned by:
Priority: minor Component: swscale
Version: git-master Keywords: ubsan
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
There're 4 left shift of negative value bugs in libswscale/input.c

libswscale/input.c:289:42: runtime error: left shift of negative value -4865
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libswscale/input.c:289:42 in 
libswscale/input.c:289:71: runtime error: left shift of negative value -9528
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libswscale/input.c:289:71 in 
libswscale/input.c:290:71: runtime error: left shift of negative value -12061
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libswscale/input.c:290:71 in 
libswscale/input.c:290:100: runtime error: left shift of negative value -2332
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libswscale/input.c:290:100 in

How to reproduce:

% ./ffmpeg_g -stream_loop 1 -y -r 41 -i msvc.avi -target svcd -map 0 -aframes 68 -r 76 -ar 22050 -ac 18 -b:v 455k output/tmp.spdif
ffmpeg version N-94887-ge55018ee11 (git master)
built on ... ubuntu 18.04 with clang-6 and UBSAN option.

Attachments (2)

gdb-input (4.8 KB ) - added by Suhwan 5 years ago.
msvc.avi (86.0 KB ) - added by Suhwan 5 years ago.
poc

Download all attachments as: .zip

Change History (3)

by Suhwan, 5 years ago

Attachment: gdb-input added

by Suhwan, 5 years ago

Attachment: msvc.avi added

poc

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: undeterminedswscale
Priority: importantminor
Resolution: fixed
Status: newclosed

Duplicate of ticket #8140, fixed by Michael in d48e510124d0fea24e2ec27271687c92e4428a18

Note: See TracTickets for help on using tickets.