Commit 8b1cd25c authored by Michael Niedermayer's avatar Michael Niedermayer

pmpdec: Check for zero audio packets.

This fixes a division by 0.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e3822886
...@@ -124,6 +124,10 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -124,6 +124,10 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
if (pmp->cur_stream == 0) { if (pmp->cur_stream == 0) {
int num_packets; int num_packets;
pmp->audio_packets = avio_r8(pb); pmp->audio_packets = avio_r8(pb);
if (!pmp->audio_packets) {
av_log_ask_for_sample(s, "0 audio packets\n");
return AVERROR_PATCHWELCOME;
}
num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1; num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1;
avio_skip(pb, 8); avio_skip(pb, 8);
pmp->current_packet = 0; pmp->current_packet = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment