Advertisement
Guest User

Untitled

a guest
Feb 5th, 2015
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.12 KB | None | 0 0
  1. diff --git a/libavformat/tta.c b/libavformat/tta.c
  2. index 5789e5b..ed17347 100644
  3. --- a/libavformat/tta.c
  4. +++ b/libavformat/tta.c
  5. @@ -84,9 +84,10 @@ static int tta_read_header(AVFormatContext *s)
  6.      }
  7.  
  8.      crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
  9. -    if (crc != avio_rl32(s->pb)) {
  10. +    if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
  11.          av_log(s, AV_LOG_ERROR, "Header CRC error\n");
  12. -        return AVERROR_INVALIDDATA;
  13. +        if (s->error_recognition & AV_EF_EXPLODE)
  14. +            return AVERROR_INVALIDDATA;
  15.      }
  16.  
  17.      c->frame_size      = samplerate * 256 / 245;
  18. @@ -130,9 +131,10 @@ static int tta_read_header(AVFormatContext *s)
  19.          framepos += size;
  20.      }
  21.      crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
  22. -    if (crc != avio_rl32(s->pb)) {
  23. +    if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
  24.          av_log(s, AV_LOG_ERROR, "Seek table CRC error\n");
  25. -        return AVERROR_INVALIDDATA;
  26. +        if (s->error_recognition & AV_EF_EXPLODE)
  27. +            return AVERROR_INVALIDDATA;
  28.      }
  29.  
  30.      st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement