av_log(s, AV_LOG_WARNING, "av_dict_set failed.\n");
} else {
char buf[256];
- if (val_len > sizeof(buf))
- return AVERROR_INVALIDDATA;
+ if (val_len > sizeof(buf)) {
+ ret = AVERROR_INVALIDDATA;
+ goto failed;
+ }
if ((ret = avio_read(pb, value, val_len)) < 0)
goto failed;
if (ret < 2 * val_len)
}
asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st));
asf_st = asf->asf_st[asf->nb_streams];
- if (!asf_st)
- return AVERROR(ENOMEM);
+ if (!asf_st) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
st->codec->codec_type = asf_st->type = AVMEDIA_TYPE_VIDEO;
} else {
if ((ret = ff_seek_frame_binary(s, stream_index, timestamp, flags)) < 0)
return ret;
-
- // asf_read_timestamp is called inside ff_seek_frame_binary and leaves state dirty,
- // so reset_packet_state have to be called after it.
- reset_packet_state(s);
}
+ reset_packet_state(s);
+
return 0;
}