diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 228ba494ae..503c8a2659 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -564,9 +564,8 @@ static int set_context_streams_from_tracks(AVFormatContext *s) /* Copy stream information */ asset_stream = avformat_new_stream(s, NULL); if (!asset_stream) { - ret = AVERROR(ENOMEM); av_log(s, AV_LOG_ERROR, "Could not create stream\n"); - break; + return AVERROR(ENOMEM); } asset_stream->id = i; ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar);