In order to not generate 0 sized packets or create a huge index table needlessly. Fixes: Timeout Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304 Fixes: 45738/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6142535657979904
Unified · Split
| @@ -5179,6 +5179,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 5178 unmodified lines | ||
| 5179 | 5179 | distance++; |
| 5180 | 5180 | if (av_sat_add64(dts, sample_duration) != dts + (uint64_t)sample_duration) |
| 5181 | 5181 | return AVERROR_INVALIDDATA; |
| 5182 | + if (!sample_size) | |
| 5183 | + return AVERROR_INVALIDDATA; | |
| 5182 | 5184 | dts += sample_duration; |
| 5183 | 5185 | offset += sample_size; |
| 5184 | 5186 | sc->data_size += sample_size; |