[FFmpeg-cvslog] smacker: Don't return packets in unallocated streams

Martin Storsjö git at videolan.org
Tue Oct 8 00:46:12 CEST 2013


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Wed Sep 11 15:20:01 2013 +0300| [057f655dc6a9a14224dd3d557606eedf15dfe64c] | committer: Luca Barbato

smacker: Don't return packets in unallocated streams

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 8d928023f953a28692ba27071a448259134b103b)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavformat/smacker.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 4a3a2b3..56a75d8 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -343,6 +343,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
         smk->cur_frame++;
         smk->nextpos = avio_tell(s->pb);
     } else {
+        if (smk->stream_id[smk->curstream] < 0)
+            return AVERROR_INVALIDDATA;
         if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
             return AVERROR(ENOMEM);
         memcpy(pkt->data, smk->bufs[smk->curstream], smk->buf_sizes[smk->curstream]);



More information about the ffmpeg-cvslog mailing list