aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/smacker.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 15:20:01 +0300
committerMartin Storsjö <martin@martin.st>2013-09-11 20:19:12 +0300
commit8d928023f953a28692ba27071a448259134b103b (patch)
treeff00d749442ca4da59321a18520a63a38e36b504 /libavformat/smacker.c
parent48d6556dd46d4f4fac10d0f4a819e314887cd50e (diff)
downloadffmpeg-8d928023f953a28692ba27071a448259134b103b.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>
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 cd4353a1b9..a15bded119 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -344,6 +344,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]);