From 1775b92fee43f0527e2f5892a5a30450fa929722 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Thu, 6 Oct 2011 22:53:41 +0200 Subject: segafilm: Check for memory allocation failures in segafilm demuxer. Signed-off-by: Janne Grunau --- libavformat/segafilm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavformat/segafilm.c') 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); -- cgit v1.1