diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-28 07:19:37 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-28 07:20:36 +0100 |
commit | 8b1cd25ca7e64e6128fa2902d78e48bfeeec9786 (patch) | |
tree | a1ced304555e1209bcf9751b30fc810523792fda /libavformat/pmpdec.c | |
parent | e3822886ebb3ae97bdae9be264d891f1d35c960b (diff) | |
download | ffmpeg-8b1cd25ca7e64e6128fa2902d78e48bfeeec9786.tar.gz |
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>
Diffstat (limited to 'libavformat/pmpdec.c')
-rw-r--r-- | libavformat/pmpdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/pmpdec.c b/libavformat/pmpdec.c index 4ef8ca3437..315e58c184 100644 --- a/libavformat/pmpdec.c +++ b/libavformat/pmpdec.c @@ -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; |