From f7813a5324be39d13ab536c245d15dfc602a7849 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 29 Dec 2013 12:19:38 +0000 Subject: basic type mechanism working --- ffmpeg/libavformat/rl2.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'ffmpeg/libavformat/rl2.c') diff --git a/ffmpeg/libavformat/rl2.c b/ffmpeg/libavformat/rl2.c index 800e12e..d354339 100644 --- a/ffmpeg/libavformat/rl2.c +++ b/ffmpeg/libavformat/rl2.c @@ -32,6 +32,8 @@ * optional background_frame */ +#include + #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" #include "avformat.h" @@ -125,19 +127,15 @@ static av_cold int rl2_read_header(AVFormatContext *s) if(signature == RLV3_TAG && back_size > 0) st->codec->extradata_size += back_size; - st->codec->extradata = av_mallocz(st->codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); - if(!st->codec->extradata) + if(ff_get_extradata(st->codec, pb, st->codec->extradata_size) < 0) return AVERROR(ENOMEM); - if(avio_read(pb,st->codec->extradata,st->codec->extradata_size) != - st->codec->extradata_size) - return AVERROR(EIO); - /** setup audio stream if present */ if(sound_rate){ - if(channels <= 0) + if (!channels || channels > 42) { + av_log(s, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels); return AVERROR_INVALIDDATA; + } pts_num = def_sound_size; pts_den = rate; -- cgit v1.2.3