History

avformat/cafdec: Check that nb_frasmes fits within 64bit

Fixes: signed integer overflow: 1099511693312 * 538976288 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6565048815845376

Michael Niedermayer committed 4 years ago

Commit d4bb4e31 parent 736e9e61 file · +1 −1Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/cafdec.c+1−1
@@ -387,7 +387,7 @@ static int read_header(AVFormatContext *s) · 386 unmodified lines
387387
388388 found_data:
389389 if (caf->bytes_per_packet > 0 && caf->frames_per_packet > 0) {
390− if (caf->data_size > 0)
390+ if (caf->data_size > 0 && caf->data_size / caf->bytes_per_packet < INT64_MAX / caf->frames_per_packet)
391391 st->nb_frames = (caf->data_size / caf->bytes_per_packet) * caf->frames_per_packet;
392392 } else if (ffstream(st)->nb_index_entries && st->duration > 0) {
393393 if (st->codecpar->sample_rate && caf->data_size / st->duration > INT64_MAX / st->codecpar->sample_rate / 8) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t