[FFmpeg-cvslog] dsicin demuxer: Fix excessive malloc()

Michael Niedermayer git at videolan.org
Mon Dec 19 16:38:05 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 19 11:47:15 2011 +0100| [9c5104e84ef8adcb6499eac040a6c5af47324e07] | committer: Michael Niedermayer

dsicin demuxer: Fix excessive malloc()
use ffio_limit()
Fixes Ticket 790
Bug found by: Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c5104e84ef8adcb6499eac040a6c5af47324e07
---

 libavformat/dsicin.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c
index 20b1d02..e0db8ba 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;



More information about the ffmpeg-cvslog mailing list