dsicin demuxer: Fix excessive malloc()
use ffio_limit() Fixes Ticket 790 Bug found by: Oana Stratulat Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e39eeb10d1
commit
9c5104e84e
@ -27,6 +27,7 @@
|
|||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "avio_internal.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct CinFileHeader {
|
typedef struct CinFileHeader {
|
||||||
@ -179,6 +180,8 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
/* palette and video packet */
|
/* palette and video packet */
|
||||||
pkt_size = (palette_type + 3) * hdr->pal_colors_count + hdr->video_frame_size;
|
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);
|
ret = av_new_packet(pkt, 4 + pkt_size);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user