summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-19 23:32:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-19 23:32:51 +0200
commit60b54e4b9fac8519bb68501b73ac0efbcce5cff0 (patch)
treea9d2f4a934bd7c9c53fd6c277bca006adc28d1d5 /avconv.c
parentada49f936eaafe12365c7b962355d6dcfbfc4029 (diff)
parente6d2b73784e5488d95c1ab76287f2eba9ca94d7d (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: avconv: Set error code before before jumping to fail. h264: fix PCM intra-coded blocks in monochrome case Conflicts: libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/avconv.c b/avconv.c
index b7f011adac..a5edc76ae1 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1975,8 +1975,10 @@ static int transcode(OutputFile *output_files,
if (ost->st->stream_copy) {
uint64_t extra_size = (uint64_t)icodec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE;
- if (extra_size > INT_MAX)
+ if (extra_size > INT_MAX) {
+ ret = AVERROR(EINVAL);
goto fail;
+ }
/* if stream_copy is selected, no need to decode or encode */
codec->codec_id = icodec->codec_id;
@@ -1993,8 +1995,10 @@ static int transcode(OutputFile *output_files,
codec->rc_max_rate = icodec->rc_max_rate;
codec->rc_buffer_size = icodec->rc_buffer_size;
codec->extradata= av_mallocz(extra_size);
- if (!codec->extradata)
+ if (!codec->extradata) {
+ ret = AVERROR(ENOMEM);
goto fail;
+ }
memcpy(codec->extradata, icodec->extradata, icodec->extradata_size);
codec->extradata_size= icodec->extradata_size;
@@ -2059,8 +2063,10 @@ static int transcode(OutputFile *output_files,
switch(codec->codec_type) {
case AVMEDIA_TYPE_AUDIO:
ost->fifo= av_fifo_alloc(1024);
- if(!ost->fifo)
+ if (!ost->fifo) {
+ ret = AVERROR(ENOMEM);
goto fail;
+ }
ost->reformat_pair = MAKE_SFMT_PAIR(AV_SAMPLE_FMT_NONE,AV_SAMPLE_FMT_NONE);
if (!codec->sample_rate) {
codec->sample_rate = icodec->sample_rate;