[FFmpeg-cvslog] segafilm: Check for memory allocation failures in segafilm demuxer.

Laurent Aimar git at videolan.org
Fri Oct 7 03:49:15 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at elivagar.org> | Thu Oct  6 22:53:41 2011 +0200| [1775b92fee43f0527e2f5892a5a30450fa929722] | committer: Janne Grunau

segafilm: Check for memory allocation failures in segafilm demuxer.

Signed-off-by: Janne Grunau <janne-libav at jannau.net>

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

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

diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index ea464f2..4bbacc5 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -257,6 +257,10 @@ static int film_read_packet(AVFormatContext *s,
             av_free(film->stereo_buffer);
             film->stereo_buffer_size = sample->sample_size;
             film->stereo_buffer = av_malloc(film->stereo_buffer_size);
+            if (!film->stereo_buffer) {
+                film->stereo_buffer_size = 0;
+                return AVERROR(ENOMEM);
+            }
         }
 
         pkt->pos= avio_tell(pb);



More information about the ffmpeg-cvslog mailing list