/* Electronic Arts Multimedia File Demuxer
- * Copyright (c) 2004 The ffmpeg Project
+ * Copyright (c) 2004 The FFmpeg Project
* Copyright (c) 2006-2008 Peter Ross
*
* This file is part of FFmpeg.
ea->sample_rate = -1;
ea->num_channels = 1;
- while (!url_feof(pb) && in_header) {
+ while (!avio_feof(pb) && in_header) {
int in_subheader;
uint8_t byte;
byte = avio_r8(pb);
case 0xFD:
av_log(s, AV_LOG_DEBUG, "entered audio subheader\n");
in_subheader = 1;
- while (!url_feof(pb) && in_subheader) {
+ while (!avio_feof(pb) && in_subheader) {
uint8_t subbyte;
subbyte = avio_r8(pb);
case pQGT_TAG:
case TGQs_TAG:
ea->video_codec = AV_CODEC_ID_TGQ;
+ ea->time_base = (AVRational) { 1, 15 };
break;
case pIQT_TAG:
ea->video_codec = AV_CODEC_ID_TQI;
+ ea->time_base = (AVRational) { 1, 15 };
break;
case MADk_TAG:
ea->video_codec = AV_CODEC_ID_MAD;
+ avio_skip(pb, 6);
+ ea->time_base = (AVRational) { avio_rl16(pb), 1000 };
break;
case MVhd_TAG:
while (!packet_read || partial_packet) {
chunk_type = avio_rl32(pb);
chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
- if (chunk_size <= 8)
+ if (chunk_size < 8)
return AVERROR_INVALIDDATA;
chunk_size -= 8;
avio_skip(pb, 8);
chunk_size -= 12;
}
+
if (partial_packet) {
avpriv_request_sample(s, "video header followed by audio packet");
av_free_packet(pkt);
partial_packet = 0;
}
+
+ if (!chunk_size)
+ continue;
+
ret = av_get_packet(pb, pkt, chunk_size);
if (ret < 0)
return ret;
goto get_video_packet;
case mTCD_TAG:
+ if (chunk_size < 8)
+ return AVERROR_INVALIDDATA;
+
avio_skip(pb, 8); // skip ea DCT header
chunk_size -= 8;
goto get_video_packet;
key = AV_PKT_FLAG_KEY;
case MV0F_TAG:
get_video_packet:
+ if (!chunk_size)
+ continue;
+
if (partial_packet) {
ret = av_append_packet(pb, pkt, chunk_size);
} else