Commit fca76dc6 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '13c90bc9'

* commit '13c90bc9':
  adts: Return more meaningful error codes

Conflicts:
	libavformat/adtsenc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 2bfd4ff1 13c90bc9
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment