]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/riff.c
Add a note about illegal codec IDs.
[ffmpeg] / libavformat / riff.c
index cc2113965c9343c6ff1085ee91547fcb47bc2fa4..431211d2425946929e0cd4caf95bc616ae3999fc 100644 (file)
@@ -2,18 +2,20 @@
  * RIFF codec tags
  * Copyright (c) 2000 Fabrice Bellard.
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -110,10 +112,13 @@ const CodecTag codec_bmp_tags[] = {
     { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') },
     { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') },
     { CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') },
+    { CODEC_ID_RAWVIDEO, MKTAG('Y', '8', '0', '0') },
     { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') },
     { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '2') },
     { CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
     { CODEC_ID_VP3, MKTAG('V', 'P', '3', '0') },
+    { CODEC_ID_VP5, MKTAG('V', 'P', '5', '0') },
+    { CODEC_ID_VP6, MKTAG('V', 'P', '6', '2') },
     { CODEC_ID_ASV1, MKTAG('A', 'S', 'V', '1') },
     { CODEC_ID_ASV2, MKTAG('A', 'S', 'V', '2') },
     { CODEC_ID_VCR1, MKTAG('V', 'C', 'R', '1') },
@@ -135,6 +140,7 @@ const CodecTag codec_bmp_tags[] = {
     { CODEC_ID_4XM, MKTAG('4', 'X', 'M', 'V') },
     { CODEC_ID_FLV1, MKTAG('F', 'L', 'V', '1') },
     { CODEC_ID_FLASHSV, MKTAG('F', 'S', 'V', '1') },
+    { CODEC_ID_VP6F, MKTAG('V', 'P', '6', 'F') },
     { CODEC_ID_SVQ1, MKTAG('s', 'v', 'q', '1') },
     { CODEC_ID_TSCC, MKTAG('t', 's', 'c', 'c') },
     { CODEC_ID_ULTI, MKTAG('U', 'L', 'T', 'I') },
@@ -188,6 +194,12 @@ const CodecTag codec_wav_tags[] = {
     { CODEC_ID_ADPCM_SWF, ('S'<<8)+'F' },
     { CODEC_ID_TRUESPEECH, 0x22 },
 
+    /* FIXME: All of the IDs below are not 16 bit and thus illegal. */
+    { CODEC_ID_FLAC, MKTAG('f', 'L', 'a', 'C') },
+    { CODEC_ID_TTA, MKTAG('T', 'T', 'A', '1') },
+    { CODEC_ID_WAVPACK, MKTAG('W', 'V', 'P', 'K') },
+    { CODEC_ID_SHORTEN, MKTAG('s', 'h', 'r', 'n') },
+
     // for NuppelVideo (nuv.c)
     { CODEC_ID_PCM_S16LE, MKTAG('R', 'A', 'W', 'A') },
     { CODEC_ID_MP3, MKTAG('L', 'A', 'M', 'E') },
@@ -274,7 +286,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
 
     if(!enc->codec_tag || enc->codec_tag > 0xffff)
        enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id);
-    if(!enc->codec_tag)
+    if(!enc->codec_tag || enc->codec_tag > 0xffff)
         return -1;
 
     put_le16(pb, enc->codec_tag);