Browse Source

pmpdec: Check for zero audio packets.

This fixes a division by 0.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Michael Niedermayer 14 years ago
parent
commit
8b1cd25ca7
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/pmpdec.c

+ 4
- 0
libavformat/pmpdec.c View File

@@ -124,6 +124,10 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
if (pmp->cur_stream == 0) {
int num_packets;
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;
avio_skip(pb, 8);
pmp->current_packet = 0;


Loading…
Cancel
Save