Browse Source

caf: fix 'pakt' chunk parsing

according to the CAF specification:
"... the value for mChunkSize can be greater than the actual valid content
of the packet table chunk"
tags/n1.0
Justin Ruggles 13 years ago
parent
commit
f5a9c35f88
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavformat/cafdec.c

+ 3
- 2
libavformat/cafdec.c View File

@@ -192,10 +192,11 @@ static int read_pakt_chunk(AVFormatContext *s, int64_t size)
st->duration += caf->frames_per_packet ? caf->frames_per_packet : ff_mp4_read_descr_len(pb);
}

if (avio_tell(pb) - ccount != size) {
if (avio_tell(pb) - ccount > size) {
av_log(s, AV_LOG_ERROR, "error reading packet table\n");
return -1;
return AVERROR_INVALIDDATA;
}
avio_skip(pb, ccount + size - avio_tell(pb));

caf->num_bytes = pos;
return 0;


Loading…
Cancel
Save