History

avformat/moflex: Check m->size before seeking

Fixes: Infinite loop Fixes: 26016/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6195663833137152

Michael Niedermayer committed 6 years ago

Commit acd735e1 parent 3291d991 file · +4 −1Browse files

Unified · Split

libavformat/moflex.c+4−1
@@ -342,8 +342,11 @@ static int moflex_read_packet(AVFormatContext *s, AVPacket *pkt) · 341 unmodified lines
342 342
343 m->in_block = 0;343 m->in_block = 0;
344 344
345 if (m->flags % 2 == 0)345 if (m->flags % 2 == 0) {
346 if (m->size <= 0)
347 return AVERROR_INVALIDDATA;
346 avio_seek(pb, m->pos + m->size, SEEK_SET);348 avio_seek(pb, m->pos + m->size, SEEK_SET);
349 }
347 }350 }
348 351
349 return AVERROR_EOF;352 return AVERROR_EOF;

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