Fixes: Infinite loop Fixes: 26016/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6195663833137152
Unified · Split
| @@ -342,8 +342,11 @@ static int moflex_read_packet(AVFormatContext *s, AVPacket *pkt) · 341 unmodified lines | ||
| 342 | 342 | |
| 343 | 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 | 348 | avio_seek(pb, m->pos + m->size, SEEK_SET); |
| 349 | + } | |
| 347 | 350 | } |
| 348 | 351 | |
| 349 | 352 | return AVERROR_EOF; |