OSDN Git Service

Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Oct 2012 13:53:42 +0000 (15:53 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Oct 2012 13:53:42 +0000 (15:53 +0200)
* qatar/master:
  configure: Add support for Tilera processors
  wavdec: check size before reading the data, not after.

Conflicts:
configure

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

diff --cc configure
+++ b/configure
@@@ -2796,7 -2522,10 +2798,10 @@@ case "$arch" i
          arch="sparc"
          subarch="sparc64"
      ;;
 -    i[3-6]86|i86pc|BePC|x86pc|x86_64|amd64)
+     tilegx|tile-gx)
+         arch="tilegx"
+     ;;
 +    i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
          arch="x86"
      ;;
  esac
@@@ -309,43 -286,12 +309,42 @@@ static int wav_read_header(AVFormatCont
              if ((ret = wav_parse_bext_tag(s, size)) < 0)
                  return ret;
              break;
 +        case MKTAG('S','M','V','0'):
 +            if (!got_fmt) {
 +                av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'SMV0' tag\n");
 +                return AVERROR_INVALIDDATA;
 +            }
 +            // SMV file, a wav file with video appended.
 +            if (size != MKTAG('0','2','0','0')) {
 +                av_log(s, AV_LOG_ERROR, "Unknown SMV version found\n");
 +                goto break_loop;
 +            }
 +            av_log(s, AV_LOG_DEBUG, "Found SMV data\n");
 +            vst = avformat_new_stream(s, NULL);
 +            if (!vst)
 +                return AVERROR(ENOMEM);
 +            avio_r8(pb);
 +            vst->id = 1;
 +            vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
 +            vst->codec->codec_id = AV_CODEC_ID_MJPEG;
 +            vst->codec->width  = avio_rl24(pb);
 +            vst->codec->height = avio_rl24(pb);
 +            size = avio_rl24(pb);
 +            wav->smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
 +            avio_rl24(pb);
 +            wav->smv_block_size = avio_rl24(pb);
 +            avpriv_set_pts_info(vst, 32, 1, avio_rl24(pb));
 +            vst->duration = avio_rl24(pb);
 +            avio_rl24(pb);
 +            avio_rl24(pb);
 +            wav->smv_frames_per_jpeg = avio_rl24(pb);
 +            goto break_loop;
          case MKTAG('L', 'I', 'S', 'T'):
-             list_type = avio_rl32(pb);
              if (size < 4) {
 -                av_log(s, AV_LOG_ERROR, "too short LIST");
 +                av_log(s, AV_LOG_ERROR, "too short LIST tag\n");
                  return AVERROR_INVALIDDATA;
              }
-             switch (list_type) {
+             switch (avio_rl32(pb)) {
              case MKTAG('I', 'N', 'F', 'O'):
                  if ((ret = ff_read_riff_info(s, size - 4)) < 0)
                      return ret;