avformat/tta: only check for header and seek table crc if requested
authorJames Almer <jamrial@gmail.com>
Fri, 6 Feb 2015 02:18:58 +0000 (23:18 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 6 Feb 2015 02:20:40 +0000 (23:20 -0300)
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/tta.c

index 5789e5b..a782bd7 100644 (file)
@@ -84,7 +84,7 @@ static int tta_read_header(AVFormatContext *s)
     }
 
     crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
-    if (crc != avio_rl32(s->pb)) {
+    if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
         av_log(s, AV_LOG_ERROR, "Header CRC error\n");
         return AVERROR_INVALIDDATA;
     }
@@ -130,7 +130,7 @@ static int tta_read_header(AVFormatContext *s)
         framepos += size;
     }
     crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
-    if (crc != avio_rl32(s->pb)) {
+    if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
         av_log(s, AV_LOG_ERROR, "Seek table CRC error\n");
         return AVERROR_INVALIDDATA;
     }