Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#7990 closed defect (fixed)

undefined-behavior at libavcodec/snowenc.c and division by zero at libavcodec/ratecontrol.c

Reported by: Suhwan Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: ubsan snowenc ratecontrol
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
There're undefined-behavior at libavcodec/snowenc.c and division by zero at libavcodec/ratecontrol.c.

How to reproduce:

% ffmpeg_g  -y -r 51 -i tmp.avi -map 0 -c:v snow -c:v:82 sgi -disposition:a msvideo1 -disposition:s:13 g726 -r 2 -ab 841k -ar 22050 -ac 5 -strict 1 tmp_.adx

ffmpeg version : N-94163-g664a27ea40
built with clang version 9.0.0

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

tmp.avi (282.5 KB ) - added by Suhwan 5 years ago.
gdb_log_7990 (14.1 KB ) - added by Suhwan 5 years ago.

Download all attachments as: .zip

Change History (5)

by Suhwan, 5 years ago

Attachment: tmp.avi added

by Suhwan, 5 years ago

Attachment: gdb_log_7990 added

comment:1 by Michael Niedermayer, 3 years ago

Resolution: fixed
Status: newclosed

The 2 undefined shifts in snowenc where fixed in 8802e329c8317ca5ceb929df48a23eb0f9e852b2
The division by 0 in ratecontrol is not an integer division so its not a bug as such

comment:2 by Michael Niedermayer, 3 years ago

I will post a patch to ffmpeg-devel to avoid the floating point division.

comment:3 by Michael Niedermayer, 3 years ago

No floating point division by 0 is reproduceable anymore since a long time
The floating point division was fixed already in 55279d699fa64d8eb1185d8db04ab4ed92e8dea2

Note: See TracTickets for help on using tickets.