This does not belong into the callback structure whose fields are
supposed to get initialized by the audio format handler. Move it to
the internal struct mp4 instead, next to the existing error counter.
uint64_t moov_size;
uint8_t last_atom;
uint64_t file_size;
uint64_t moov_size;
uint8_t last_atom;
uint64_t file_size;
uint32_t error;
/* incremental track index while reading the file */
uint32_t error;
/* incremental track index while reading the file */
result = f->stream->read(f->stream->user_data, data, size);
if (result < size)
result = f->stream->read(f->stream->user_data, data, size);
if (result < size)
- f->stream->read_error++;
f->current_position += size;
f->current_position += size;
if (t->stsz_sample_size != 0)
return 0;
t->stsz_table = para_malloc(t->stsz_sample_count * sizeof(int32_t));
if (t->stsz_sample_size != 0)
return 0;
t->stsz_table = para_malloc(t->stsz_sample_count * sizeof(int32_t));
- for (i = 0; i < t->stsz_sample_count && !f->stream->read_error; i++)
+ for (i = 0; i < t->stsz_sample_count && !f->read_error; i++)
t->stsz_table[i] = read_int32(f);
return 0;
}
t->stsz_table[i] = read_int32(f);
return 0;
}
t->stts_sample_delta = para_malloc(t->stts_entry_count
* sizeof (int32_t));
/* CVE-2017-9254 */
t->stts_sample_delta = para_malloc(t->stts_entry_count
* sizeof (int32_t));
/* CVE-2017-9254 */
- for (i = 0; i < t->stts_entry_count && !f->stream->read_error; i++) {
+ for (i = 0; i < t->stts_entry_count && !f->read_error; i++) {
t->stts_sample_count[i] = read_int32(f);
t->stts_sample_delta[i] = read_int32(f);
}
t->stts_sample_count[i] = read_int32(f);
t->stts_sample_delta[i] = read_int32(f);
}
sizeof (int32_t));
/* CVE-2017-9255 */
sizeof (int32_t));
/* CVE-2017-9255 */
- for (i = 0; i < t->stsc_entry_count && !f->stream->read_error; i++) {
+ for (i = 0; i < t->stsc_entry_count && !f->read_error; i++) {
t->stsc_first_chunk[i] = read_int32(f);
t->stsc_samples_per_chunk[i] = read_int32(f);
t->stsc_sample_desc_index[i] = read_int32(f);
t->stsc_first_chunk[i] = read_int32(f);
t->stsc_samples_per_chunk[i] = read_int32(f);
t->stsc_sample_desc_index[i] = read_int32(f);
t->stco_chunk_offset = para_malloc(t->stco_entry_count
* sizeof(int32_t));
/* CVE-2017-9256 */
t->stco_chunk_offset = para_malloc(t->stco_entry_count
* sizeof(int32_t));
/* CVE-2017-9256 */
- for (i = 0; i < t->stco_entry_count && !f->stream->read_error; i++)
+ for (i = 0; i < t->stco_entry_count && !f->read_error; i++)
t->stco_chunk_offset[i] = read_int32(f);
return 0;
}
t->stco_chunk_offset[i] = read_int32(f);
return 0;
}
entry_count = read_int32(f);
/* CVE-2017-9253 */
entry_count = read_int32(f);
/* CVE-2017-9253 */
- for (i = 0; i < entry_count && !f->stream->read_error; i++) {
+ for (i = 0; i < entry_count && !f->read_error; i++) {
uint64_t skip = get_position(f);
uint64_t size;
uint8_t atom_type = 0;
uint64_t skip = get_position(f);
uint64_t size;
uint8_t atom_type = 0;
- sumsize < size && !f->stream->read_error; /* CVE-2017-9222 */
+ sumsize < size && !f->read_error; /* CVE-2017-9222 */
set_position(f, destpos), sumsize += subsize
) {
subsize = atom_read_header(f, &atom_type, &header_size);
set_position(f, destpos), sumsize += subsize
) {
subsize = atom_read_header(f, &atom_type, &header_size);
uint8_t header_size = 0;
f->file_size = 0;
uint8_t header_size = 0;
f->file_size = 0;
- f->stream->read_error = 0;
while ((size =
atom_read_header(f, &atom_type, &header_size)) != 0) {
while ((size =
atom_read_header(f, &atom_type, &header_size)) != 0) {
uint32_t (*seek)(void *user_data, uint64_t position);
uint32_t (*truncate)(void *user_data);
void *user_data;
uint32_t (*seek)(void *user_data, uint64_t position);
uint32_t (*truncate)(void *user_data);
void *user_data;