diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-21 21:56:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-21 21:56:33 +0200 |
commit | fca76dc61ed650477c6e537b9db7c4ae2767197b (patch) | |
tree | c01c02fc8e7e628da3eb9662a3a57e1ed84d6e59 /libavformat | |
parent | 2bfd4ff16dddc46d30b9e3510cb31e3b1b1b90fe (diff) | |
parent | 13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9 (diff) | |
download | ffmpeg-fca76dc61ed650477c6e537b9db7c4ae2767197b.tar.gz |
Merge commit '13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9'
* commit '13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9':
adts: Return more meaningful error codes
Conflicts:
libavformat/adtsenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/adtsenc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 9ec1181177..d624b79607 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -63,23 +63,23 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t if (adts->objecttype > 3U) { av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype+1); - return -1; + return AVERROR_INVALIDDATA; } if (adts->sample_rate_index == 15) { av_log(s, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n"); - return -1; + return AVERROR_INVALIDDATA; } if (get_bits(&gb, 1)) { av_log(s, AV_LOG_ERROR, "960/120 MDCT window is not allowed in ADTS\n"); - return -1; + return AVERROR_INVALIDDATA; } if (get_bits(&gb, 1)) { av_log(s, AV_LOG_ERROR, "Scalable configurations are not allowed in ADTS\n"); - return -1; + return AVERROR_INVALIDDATA; } if (get_bits(&gb, 1)) { av_log(s, AV_LOG_ERROR, "Extension flag is not allowed in ADTS\n"); - return -1; + return AVERROR_INVALIDDATA; } if (!adts->channel_conf) { init_put_bits(&pb, adts->pce_data, MAX_PCE_SIZE); @@ -101,9 +101,9 @@ static int adts_write_header(AVFormatContext *s) if (adts->id3v2tag) ff_id3v2_write_simple(s, 4, ID3v2_DEFAULT_MAGIC); - if (avc->extradata_size > 0 && - adts_decode_extradata(s, adts, avc->extradata, avc->extradata_size) < 0) - return -1; + if (avc->extradata_size > 0) + return adts_decode_extradata(s, adts, avc->extradata, + avc->extradata_size); return 0; } |