[FFmpeg-cvslog] mm: Skip unexpected audio packets

Luca Barbato git at videolan.org
Sun Oct 29 00:17:51 EEST 2017


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Mon Apr 17 19:25:35 2017 +0000| [1731c3530bffb876deb9e00dfffdf9841a8412cd] | committer: Luca Barbato

mm: Skip unexpected audio packets

Bug-Id: 1046
CC: libav-stable at libav.org

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

 libavformat/mm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/mm.c b/libavformat/mm.c
index 16505502fd..a94d2611a2 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -174,6 +174,12 @@ static int read_packet(AVFormatContext *s,
             return 0;
 
         case MM_TYPE_AUDIO :
+            if (s->nb_streams != 2) {
+                av_log(s, AV_LOG_ERROR,
+                       "Unexpected audio packet, skipping\n");
+                avio_skip(pb, length);
+                return AVERROR_INVALIDDATA;
+            }
             if (av_get_packet(s->pb, pkt, length)<0)
                 return AVERROR(ENOMEM);
             pkt->size = length;



More information about the ffmpeg-cvslog mailing list