OSDN Git Service

Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Oct 2013 10:24:13 +0000 (12:24 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Oct 2013 10:24:13 +0000 (12:24 +0200)
* qatar/master:
  oggparsevorbis: return meaningful errors

Conflicts:
libavformat/oggparsevorbis.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/oggparsevorbis.c

@@@ -269,20 -241,14 +269,20 @@@ static int vorbis_header(AVFormatContex
          const uint8_t *p = os->buf + os->pstart + 7; /* skip "\001vorbis" tag */
          unsigned blocksize, bs0, bs1;
          int srate;
 +        int channels;
  
          if (os->psize != 30)
-             return -1;
+             return AVERROR_INVALIDDATA;
  
          if (bytestream_get_le32(&p) != 0) /* vorbis_version */
-             return -1;
+             return AVERROR_INVALIDDATA;
  
 -        st->codec->channels = bytestream_get_byte(&p);
 +        channels = bytestream_get_byte(&p);
 +        if (st->codec->channels && channels != st->codec->channels) {
 +            av_log(s, AV_LOG_ERROR, "Channel change is not supported\n");
 +            return AVERROR_PATCHWELCOME;
 +        }
 +        st->codec->channels = channels;
          srate               = bytestream_get_le32(&p);
          p += 4; // skip maximum bitrate
          st->codec->bit_rate = bytestream_get_le32(&p); // nominal bitrate