[FFmpeg-cvslog] Fixed segfault on corrupted smacker streams in the demuxer.

Laurent Aimar git at videolan.org
Thu Nov 3 03:57:39 CET 2011


ffmpeg | branch: release/0.5 | Laurent Aimar <fenrir at videolan.org> | Sun Sep 11 18:51:52 2011 +0200| [6108f04d4f33611c5f878dd245fd268e18a06f98] | committer: Michael Niedermayer

Fixed segfault on corrupted smacker streams in the demuxer.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d0121e8d969cde74fa7dbd96d3602109b051e701)

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

 libavformat/smacker.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index a34dfde..b4fc5f7 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -284,6 +284,10 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
                 frame_size -= 4;
                 smk->curstream++;
                 smk->bufs[smk->curstream] = av_realloc(smk->bufs[smk->curstream], size);
+                if (!smk->bufs[smk->curstream]) {
+                    smk->buf_sizes[smk->curstream] = 0;
+                    return AVERROR(ENOMEM);
+                }
                 smk->buf_sizes[smk->curstream] = size;
                 ret = get_buffer(s->pb, smk->bufs[smk->curstream], size);
                 if(ret != size)



More information about the ffmpeg-cvslog mailing list