diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-19 11:47:15 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-19 11:57:34 +0100 |
commit | 9c5104e84ef8adcb6499eac040a6c5af47324e07 (patch) | |
tree | affe6d7542445131d05ebbcebf35461578776764 /libavformat/dsicin.c | |
parent | e39eeb10d1b36b5681e42a7539d5b168fa292d61 (diff) | |
download | ffmpeg-9c5104e84ef8adcb6499eac040a6c5af47324e07.tar.gz |
dsicin demuxer: Fix excessive malloc()
use ffio_limit()
Fixes Ticket 790
Bug found by: Oana Stratulat
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dsicin.c')
-rw-r--r-- | libavformat/dsicin.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index 20b1d02f36..e0db8ba10e 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -27,6 +27,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" +#include "avio_internal.h" typedef struct CinFileHeader { @@ -179,6 +180,8 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt) /* palette and video packet */ pkt_size = (palette_type + 3) * hdr->pal_colors_count + hdr->video_frame_size; + pkt_size = ffio_limit(pb, pkt_size); + ret = av_new_packet(pkt, 4 + pkt_size); if (ret < 0) return ret; |