ast->codecpar->channels = read_line_and_int(pb, &error); // number of audio channels
error |= read_line(pb, line, sizeof(line));
ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error); // audio bits per sample
- strcpy(audio_type, endptr);
+ av_strlcpy(audio_type, endptr, RPL_LINE_LENGTH);
// At least one sample uses 0 for ADPCM, which is really 4 bits
// per sample.
if (ast->codecpar->bits_per_coded_sample == 0)
error |= read_line(pb, line, sizeof(line));
}
+ if (s->nb_streams == 0)
+ return AVERROR_INVALIDDATA;
+
rpl->frames_per_chunk = read_line_and_int(pb, &error); // video frames per chunk
if (vst && rpl->frames_per_chunk > 1 && vst->codecpar->codec_tag != 124)
av_log(s, AV_LOG_WARNING,
stream = s->streams[rpl->chunk_part];
- if (rpl->chunk_number >= stream->nb_index_entries)
+ if (rpl->chunk_number >= stream->internal->nb_index_entries)
return AVERROR_EOF;
- index_entry = &stream->index_entries[rpl->chunk_number];
+ index_entry = &stream->internal->index_entries[rpl->chunk_number];
if (rpl->frame_in_part == 0)
if (avio_seek(pb, index_entry->pos, SEEK_SET) < 0)
if (ret < 0)
return ret;
if (ret != frame_size) {
- av_packet_unref(pkt);
return AVERROR(EIO);
}
pkt->duration = 1;
if (ret < 0)
return ret;
if (ret != index_entry->size) {
- av_packet_unref(pkt);
return AVERROR(EIO);
}
return ret;
}
-AVInputFormat ff_rpl_demuxer = {
+const AVInputFormat ff_rpl_demuxer = {
.name = "rpl",
.long_name = NULL_IF_CONFIG_SMALL("RPL / ARMovie"),
.priv_data_size = sizeof(RPLContext),