mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-05 23:00:02 +00:00
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 8d928023f9
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
3bd0cd2677
commit
057f655dc6
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user