R3DContext *r3d = s->priv_data;
char filename[258];
int tmp;
+ int ret;
int av_unused tmp2;
AVRational framerate;
r3d->audio_channels = avio_r8(s->pb); // audio channels
av_log(s, AV_LOG_TRACE, "audio channels %d\n", tmp);
- avio_read(s->pb, filename, 257);
+ ret = avio_read(s->pb, filename, 257);
+ if (ret < 257)
+ return ret < 0 ? ret : AVERROR_EOF;
filename[sizeof(filename)-1] = 0;
av_dict_set(&st->metadata, "filename", filename, 0);
pkt->stream_index = 1;
pkt->dts = dts;
- if (st->codecpar->sample_rate)
+
+ if (st->codecpar->sample_rate && samples > 0)
pkt->duration = av_rescale(samples, st->time_base.den, st->codecpar->sample_rate);
av_log(s, AV_LOG_TRACE, "pkt dts %"PRId64" duration %"PRId64" samples %d sample rate %d\n",
pkt->dts, pkt->duration, samples, st->codecpar->sample_rate);
return 0;
}
-AVInputFormat ff_r3d_demuxer = {
+const AVInputFormat ff_r3d_demuxer = {
.name = "r3d",
.long_name = NULL_IF_CONFIG_SMALL("REDCODE R3D"),
.priv_data_size = sizeof(R3DContext),