aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-19 11:47:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:49:56 +0100
commit0ab9072ee032df3c716a98cf3b4fef2000053289 (patch)
tree4ecf31649f1b4cc6c03c741257898095d978303a
parent3461d275063a4fe47e0dfc90cebe4cb54b69cca1 (diff)
downloadffmpeg-0ab9072ee032df3c716a98cf3b4fef2000053289.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> (cherry picked from commit 9c5104e84ef8adcb6499eac040a6c5af47324e07) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/dsicin.c3
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;