History

avformat/dxa: check bpc

Fixes: integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fixes: 373971762/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-4880491112103936

Michael Niedermayer committed 2 years ago

Commit 7e020f21 parent aeec39f1 file · +2 −0Browse files

Unified · Split

libavformat/dxa.c+2−0
@@ -120,6 +120,8 @@ static int dxa_read_header(AVFormatContext *s) · 119 unmodified lines
120 avio_skip(pb, fsize);120 avio_skip(pb, fsize);
121 }121 }
122 c->bpc = (fsize + (int64_t)c->frames - 1) / c->frames;122 c->bpc = (fsize + (int64_t)c->frames - 1) / c->frames;
123 if (c->bpc < 0)
124 return AVERROR_INVALIDDATA;
123 if(ast->codecpar->block_align) {125 if(ast->codecpar->block_align) {
124 if (c->bpc > INT_MAX - ast->codecpar->block_align + 1)126 if (c->bpc > INT_MAX - ast->codecpar->block_align + 1)
125 return AVERROR_INVALIDDATA;127 return AVERROR_INVALIDDATA;

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