Opened 5 years ago

Closed 5 years ago

#8220 closed defect (fixed)

left shift of 1 by 31 places cannot be represented in type 'int' in libavcodec/cinepakenc.c

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

Description

Summary of the bug:
There is a left shift of 1 by 31 places cannot be represented in type 'int' in libavcodec/cinepakenc.c

libavcodec/cinepakenc.c:602:32: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavcodec/cinepakenc.c:602:32 in

How to reproduce:

% ffmpeg_g -t 3 -stream_loop 23 -y -i $PoC -loglevel 0 -map 0 -c copy -c:v:0 cinepak -c:v:52 text -disposition:s:8 adpcm_ms -disposition:v:213 r10k -vframes 95 -aframes 2 -ab 104k -strict 3 tmp.avs2

ffmpeg version N-95199-g9847380f5f Copyright (c) 2000-2019 the FFmpeg developers
  built with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
  configuration: --cc=clang --cxx=clang++ --ld=clang --enable-debug --toolchain=clang-usan

Attachments (2)

gdb-cinepakenc (11.4 KB ) - added by Suhwan 5 years ago.
PoC_cin.webp (50 bytes ) - added by Suhwan 5 years ago.
poc

Download all attachments as: .zip

Change History (3)

by Suhwan, 5 years ago

Attachment: gdb-cinepakenc added

by Suhwan, 5 years ago

Attachment: PoC_cin.webp added

poc

comment:1 by mkver, 5 years ago

Component: undeterminedavcodec
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.