aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/smacker.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 15:20:01 +0300
committerLuca Barbato <lu_zero@gentoo.org>2013-10-03 20:29:21 +0200
commit057f655dc6a9a14224dd3d557606eedf15dfe64c (patch)
treef35ef62dfd1153d803f4fcc6700a1ab0696472ff /libavformat/smacker.c
parent3bd0cd26774dcc69a0ea7d53c5f3d38c6fad30ae (diff)
downloadffmpeg-057f655dc6a9a14224dd3d557606eedf15dfe64c.tar.gz
smacker: Don't return packets in unallocated streams
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 8d928023f953a28692ba27071a448259134b103b) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r--libavformat/smacker.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 4a3a2b39d1..56a75d8fa1 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]);