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

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
pull/115/head^2
James Almer 10 years ago
parent a6c2c8fe3f
commit 15a88468ae
  1. 4
      libavformat/tta.c

@ -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;
}

Loading…
Cancel
Save