return avio_seek(bc, pos, whence);
}
-static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
+static int nut_read_header(AVFormatContext * avf) {
NUTContext * priv = avf->priv_data;
AVIOContext * bc = avf->pb;
nut_demuxer_opts_tt dopts = {
nut_stream_header_tt * s;
int ret, i;
+ if(!nut)
+ return -1;
+
if ((ret = nut_read_headers(nut, &s, NULL))) {
av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret));
nut_demuxer_uninit(nut);
+ priv->nut = NULL;
return -1;
}
st->codec->extradata = av_mallocz(st->codec->extradata_size);
if(!st->codec->extradata){
nut_demuxer_uninit(nut);
+ priv->nut = NULL;
return AVERROR(ENOMEM);
}
memcpy(st->codec->extradata, s[i].codec_specific, st->codec->extradata_size);