Skip to content

Commit

Permalink
dsicin demuxer: Fix excessive malloc()
Browse files Browse the repository at this point in the history
use ffio_limit()
Fixes Ticket 790
Bug found by: Oana Stratulat

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Dec 19, 2011
1 parent e39eeb1 commit 9c5104e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavformat/dsicin.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"


typedef struct CinFileHeader {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9c5104e

Please sign in to comment.