History

avformat/nuv: Check channels

Fixes: signed integer overflow: -3468545475927866368 * 4 cannot be represented in type 'long' Fixes: 28879/clusterfuzz-testcase-minimized-ffmpeg_dem_NUV_fuzzer-6303367307591680

Michael Niedermayer committed 5 years ago

Commit fc45d921 parent f3e4ebb1 file · +4 −0Browse files

Unified · Split

libavformat/nuv.c+4−0
@@ -117,6 +117,10 @@ static int get_codec_data(AVFormatContext *s, AVIOContext *pb, AVStream *vst, · 116 unmodified lines
117117 ast->codecpar->bits_per_coded_sample = avio_rl32(pb);
118118 ast->codecpar->channels = avio_rl32(pb);
119119 ast->codecpar->channel_layout = 0;
120+ if (ast->codecpar->channels <= 0) {
121+ av_log(s, AV_LOG_ERROR, "Invalid channels %d\n", ast->codecpar->channels);
122+ return AVERROR_INVALIDDATA;
123+ }
120124
121125 id = ff_wav_codec_get_id(ast->codecpar->codec_tag,
122126 ast->codecpar->bits_per_coded_sample);

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