[FFmpeg-cvslog] pmpdec: check that there is at least one audio packet.

Anton Khirnov git at videolan.org
Sun Jan 12 16:13:01 CET 2014


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Thu Nov 28 10:54:35 2013 +0100| [a8f6d93071a8ac1f039a4ee2ae1f74dcd77da1cb] | committer: Reinhard Tartler

pmpdec: check that there is at least one audio packet.

The code cannot handle there being none, but that should not happen for
valid files.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org
(cherry picked from commit 1b5d065ca722eb8028c7a08e054b6da3419faf5d)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8f6d93071a8ac1f039a4ee2ae1f74dcd77da1cb
---

 libavformat/pmpdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/pmpdec.c b/libavformat/pmpdec.c
index 6cdce10..b2c613a 100644
--- a/libavformat/pmpdec.c
+++ b/libavformat/pmpdec.c
@@ -124,6 +124,11 @@ 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(s, AV_LOG_ERROR, "No audio packets.\n");
+            return AVERROR_INVALIDDATA;
+        }
+
         num_packets = (pmp->num_streams - 1) * pmp->audio_packets + 1;
         avio_skip(pb, 8);
         pmp->current_packet = 0;



More information about the ffmpeg-cvslog mailing list