segafilm: Check for memory allocation failures in segafilm demuxer.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
This commit is contained in:
Laurent Aimar 2011-10-06 22:53:41 +02:00 committed by Janne Grunau
parent 762ffa6861
commit 1775b92fee
1 changed files with 4 additions and 0 deletions

View File

@ -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);