Commit 15a88468 authored by James Almer's avatar James Almer

avformat/tta: only check for header and seek table crc if requested

Reviewed-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent a6c2c8fe
......@@ -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;
}
......
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