[FFmpeg-cvslog] avformat/smacker: Check if bufs has been allocated before use

Michael Niedermayer git at videolan.org
Thu Sep 19 15:24:11 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 19 14:20:21 2013 +0200| [8be56e464bdeeeb8fc0a3a6d8f709c0890c585dd] | committer: Michael Niedermayer

avformat/smacker: Check if bufs has been allocated before use

Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/smacker.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index b9bb07e..0f52dc1 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -351,7 +351,7 @@ 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)
+        if (smk->stream_id[smk->curstream] < 0 || !smk->bufs[smk->curstream])
             return AVERROR_INVALIDDATA;
         if (av_new_packet(pkt, smk->buf_sizes[smk->curstream]))
             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list