diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-12 20:58:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-12 21:45:07 +0200 |
commit | 7cbe02575868e7d25acf3d319ece664702700f0a (patch) | |
tree | d7208301411546d4d1f76fa3745906bdffe438dc /libavformat | |
parent | 3eb1e65f5f69a73b9b59a10eefb57cff402207a4 (diff) | |
download | ffmpeg-7cbe02575868e7d25acf3d319ece664702700f0a.tar.gz |
segafilm: Check for memory allocation failures in segafilm demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/segafilm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 7a84daf2ef..00a248ed26 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -176,6 +176,8 @@ static int film_read_header(AVFormatContext *s, if(film->sample_count >= UINT_MAX / sizeof(film_sample)) return -1; film->sample_table = av_malloc(film->sample_count * sizeof(film_sample)); + if (!film->sample_table) + return AVERROR(ENOMEM); for(i=0; i<s->nb_streams; i++) av_set_pts_info(s->streams[i], 33, 1, film->base_clock); @@ -252,6 +254,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); |