diff --git a/libavformat/voc_packet.c b/libavformat/voc_packet.c index 1e2e19e1c3..9d7d2025cd 100644 --- a/libavformat/voc_packet.c +++ b/libavformat/voc_packet.c @@ -44,6 +44,8 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) AVINDEX_KEYFRAME); while (!voc->remaining_size) { + if (max_size < 4) + max_size = 0; type = avio_r8(pb); if (type == VOC_TYPE_EOF) return AVERROR_EOF;