[FFmpeg-cvslog] segafilm: Check for memory allocation failures in segafilm demuxer.
Laurent Aimar
git at videolan.org
Mon Mar 19 05:30:25 CET 2012
ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at elivagar.org> | Thu Oct 6 22:53:41 2011 +0200| [ea5a5f09088c94d32492173c2fc39b8eb36e56d1] | committer: Reinhard Tartler
segafilm: Check for memory allocation failures in segafilm demuxer.
Signed-off-by: Janne Grunau <janne-libav at jannau.net>
(cherry picked from commit 1775b92fee43f0527e2f5892a5a30450fa929722)
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea5a5f09088c94d32492173c2fc39b8eb36e56d1
---
libavformat/segafilm.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index 0ad5fbb..6cd0615 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -238,6 +238,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