diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-25 04:49:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-25 04:49:23 +0100 |
commit | 1795fed7bc7a8b8109757cb5f27198c5b05698b5 (patch) | |
tree | 8341cec2ee6e50652f19decb10f024987946299d | |
parent | 27d323577c19af218f8a5ac33364f213b623a023 (diff) | |
download | ffmpeg-1795fed7bc7a8b8109757cb5f27198c5b05698b5.tar.gz |
segafilm: fail earlier in case theres not enough bytestream left for a
audio packet.
This prevents a potentially large memory allocation.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/segafilm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 17b118a91c..c2a163d9fc 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -30,6 +30,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" +#include "avio_internal.h" #define FILM_TAG MKBETAG('F', 'I', 'L', 'M') #define FDSC_TAG MKBETAG('F', 'D', 'S', 'C') @@ -264,6 +265,8 @@ static int film_read_packet(AVFormatContext *s, (film->audio_type != CODEC_ID_ADPCM_ADX)) { /* stereo PCM needs to be interleaved */ + if (ffio_limit(pb, sample->sample_size) != sample->sample_size) + return AVERROR(EIO); if (av_new_packet(pkt, sample->sample_size)) return AVERROR(ENOMEM); |